Skip to content

fix(socketio): fallback for when socket.handshake.address is not provided #369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions app/templates/server/config/_local.env.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
// This file should not be tracked by git.

module.exports = {
SESSION_SECRET: "<%= _.slugify(appname) + '-secret' %>",
FACEBOOK_ID: "app-id",
FACEBOOK_SECRET: "secret",
TWITTER_ID: "app-id",
TWITTER_SECRET: "secret",
GOOGLE_ID: "app-id",
GOOGLE_SECRET: "secret",
DOMAIN: 'http://localhost:9000',
SESSION_SECRET: "<%= _.slugify(appname) + '-secret' %>",

FACEBOOK_ID: 'app-id',
FACEBOOK_SECRET: 'secret',

TWITTER_ID: 'app-id',
TWITTER_SECRET: 'secret',

GOOGLE_ID: 'app-id',
GOOGLE_SECRET: 'secret',

// Control debug level for modules using visionmedia/debug
// DEBUG: ""
};
6 changes: 3 additions & 3 deletions app/templates/server/config/environment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ var all = {
facebook: {
clientID: process.env.FACEBOOK_ID || 'id',
clientSecret: process.env.FACEBOOK_SECRET || 'secret',
callbackURL: 'http://localhost:9000/auth/facebook/callback'
callbackURL: process.env.DOMAIN + '/auth/facebook/callback'
},
<% } %><% if(filters.twitterAuth) { %>
twitter: {
clientID: process.env.TWITTER_ID || 'id',
clientSecret: process.env.TWITTER_SECRET || 'secret',
callbackURL: 'http://localhost:9000/auth/twitter/callback'
callbackURL: process.env.DOMAIN + '/auth/twitter/callback'
},
<% } %><% if(filters.googleAuth) { %>
google: {
clientID: process.env.GOOGLE_ID || 'id',
clientSecret: process.env.GOOGLE_SECRET || 'secret',
callbackURL: 'http://localhost:9000/auth/google/callback'
callbackURL: process.env.DOMAIN + '/auth/google/callback'
}<% } %>
};

Expand Down
6 changes: 4 additions & 2 deletions app/templates/server/config/socketio(socketio).js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ module.exports = function (socketio) {
// }));

socketio.on('connection', function (socket) {
socket.address = socket.handshake.address.address + ':' +
socket.handshake.address.port;
socket.address = socket.handshake.address !== null ?
socket.handshake.address.address + ':' + socket.handshake.address.port :
process.env.DOMAIN;

socket.connectedAt = new Date();

// Call onDisconnect.
Expand Down