Skip to content

Commit a9bdcb9

Browse files
committed
Merge pull request #1177 from kingcody/fix/update-socketio-info
Fix: update socketio info
2 parents b74e5fc + f4bf685 commit a9bdcb9

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

Diff for: app/templates/_package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
"passport-facebook": "latest",<% } %><% if (filters.twitterAuth) { %>
2929
"passport-twitter": "latest",<% } %><% if (filters.googleAuth) { %>
3030
"passport-google-oauth": "latest",<% } %><% if (filters.socketio) { %>
31-
"socket.io": "^1.0.6",
32-
"socket.io-client": "^1.0.6",
33-
"socketio-jwt": "^3.0.0",<% } %>
31+
"socket.io": "^1.3.5",
32+
"socket.io-client": "^1.3.5",
33+
"socketio-jwt": "^4.2.0",<% } %>
3434
"serve-favicon": "~2.0.1"
3535
},
3636
"devDependencies": {

Diff for: app/templates/server/config/socketio(socketio).js

+3-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = function(socketio) {
2727
//
2828
// ex: DEBUG: "http*,socket.io:socket"
2929

30-
// We can authenticate socket.io users and access their token through socket.handshake.decoded_token
30+
// We can authenticate socket.io users and access their token through socket.decoded_token
3131
//
3232
// 1. You will need to send the token in `client/components/socket/socket.service.js`
3333
//
@@ -38,10 +38,8 @@ module.exports = function(socketio) {
3838
// }));
3939

4040
socketio.on('connection', function(socket) {
41-
socket.address =
42-
socket.handshake.address !== null ?
43-
socket.handshake.address.address + ':' + socket.handshake.address.port :
44-
process.env.DOMAIN;
41+
socket.address = socket.request.connection.remoteAddress +
42+
':' + socket.request.connection.remotePort;
4543

4644
socket.connectedAt = new Date();
4745

0 commit comments

Comments
 (0)