Skip to content

Commit af5960b

Browse files
committed
address.remoteAddress -> address.address just like node's
1 parent 206cfdf commit af5960b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

lib/manager.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -822,13 +822,13 @@ Manager.prototype.handshakeData = function (data) {
822822

823823
if (connection.remoteAddress) {
824824
connectionAddress = {
825-
remoteAddress: connection.remoteAddress
826-
, remotePort: connection.remotePort
825+
address: connection.remoteAddress
826+
, port: connection.remotePort
827827
};
828828
} else if (connection.socket && connection.socket.remoteAddress) {
829829
connectionAddress = {
830-
remoteAddress: connection.socket.remoteAddress
831-
, remotePort: connection.socket.remotePort
830+
address: connection.socket.remoteAddress
831+
, port: connection.socket.remotePort
832832
};
833833
}
834834

test/namespace.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ module.exports = {
8080
fn(null, true);
8181
})
8282
.on('connection', function (socket) {
83-
(!!socket.handshake.address.remoteAddress).should.be.true;
84-
(!!socket.handshake.address.remotePort).should.be.true;
83+
(!!socket.handshake.address.address).should.be.true;
84+
(!!socket.handshake.address.port).should.be.true;
8585
socket.handshake.headers.host.should.equal('localhost');
8686
socket.handshake.headers.connection.should.equal('keep-alive');
8787
socket.handshake.time.should.match(/GMT/);

test/transports.websocket.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,8 +1493,8 @@ module.exports = {
14931493
, ws;
14941494

14951495
io.sockets.on('connection', function (socket) {
1496-
(!!socket.handshake.address.remoteAddress).should.be.true;
1497-
(!!socket.handshake.address.remotePort).should.be.true;
1496+
(!!socket.handshake.address.address).should.be.true;
1497+
(!!socket.handshake.address.port).should.be.true;
14981498
socket.handshake.headers.host.should.equal('localhost');
14991499
socket.handshake.headers.connection.should.equal('keep-alive');
15001500
socket.handshake.time.should.match(/GMT/);

0 commit comments

Comments
 (0)