Skip to content

Commit 9c80317

Browse files
committed
Merge pull request socketio#1685 from rase-/fix/remote-address-in-handshake-obj
Fix remote address in handshake obj
2 parents 3d9e52c + d163d89 commit 9c80317

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/socket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Socket.prototype.buildHandshake = function(){
108108
return {
109109
headers: this.request.headers,
110110
time: (new Date) + '',
111-
address: this.request.connection.address(),
111+
address: this.conn.remoteAddress,
112112
xdomain: !!this.request.headers.origin,
113113
secure: !!this.request.connection.encrypted,
114114
issued: +(new Date),

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"test": "make test"
2020
},
2121
"dependencies": {
22-
"engine.io": "Automattic/engine.io#588af6",
22+
"engine.io": "Automattic/engine.io#15afd3",
2323
"socket.io-parser": "2.2.1",
2424
"socket.io-client": "Automattic/socket.io-client#05c9632",
2525
"socket.io-adapter": "0.2.0",

test/socket.io.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ describe('socket.io', function(){
116116
expect(s.handshake.time.split(' ').length > 0); // Is "multipart" string representation
117117

118118
// Address, xdomain, secure, issued and url set
119-
expect(s.handshake.address).to.not.be(undefined);
119+
expect(s.handshake.address).to.be('127.0.0.1');
120120
expect(s.handshake.xdomain).to.be.a('boolean');
121121
expect(s.handshake.secure).to.be.a('boolean');
122122
expect(s.handshake.issued).to.be.a('number');

0 commit comments

Comments
 (0)