Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Auto-Tweetstorm server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
websiteag
auto-tweetstorm
Auto-Tweetstorm server
Commits
b3991389
Commit
b3991389
authored
6 years ago
by
Jared Hanson
Browse files
Options
Downloads
Patches
Plain Diff
Add proxy support for running behind Heroku.
parent
c93a4cb4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
server.js
+9
-1
9 additions, 1 deletion
server.js
with
11 additions
and
1 deletion
.gitignore
+
2
−
0
View file @
b3991389
.env
# Mac OS X
.DS_Store
...
...
This diff is collapsed.
Click to expand it.
server.js
+
9
−
1
View file @
b3991389
...
...
@@ -2,6 +2,13 @@ var express = require('express');
var
passport
=
require
(
'
passport
'
);
var
Strategy
=
require
(
'
passport-twitter
'
).
Strategy
;
var
trustProxy
=
false
;
if
(
process
.
env
.
DYNO
)
{
// Apps on heroku are behind a trusted proxy
trustProxy
=
true
;
}
console
.
log
(
'
TRUST PROXY?
'
+
trustProxy
);
// Configure the Twitter strategy for use by Passport.
//
...
...
@@ -13,7 +20,8 @@ var Strategy = require('passport-twitter').Strategy;
passport
.
use
(
new
Strategy
({
consumerKey
:
process
.
env
[
'
TWITTER_CONSUMER_KEY
'
],
consumerSecret
:
process
.
env
[
'
TWITTER_CONSUMER_SECRET
'
],
callbackURL
:
'
/oauth/callback/twitter.com
'
callbackURL
:
'
/oauth/callback/twitter.com
'
,
proxy
:
trustProxy
},
function
(
token
,
tokenSecret
,
profile
,
cb
)
{
// In this example, the user's Twitter profile is supplied as the user
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment