File tree 3 files changed +14
-8
lines changed
3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -820,10 +820,16 @@ Manager.prototype.handshakeData = function (data) {
820
820
var connection = data . request . connection
821
821
, connectionAddress ;
822
822
823
- if ( connection . address ) {
824
- connectionAddress = connection . address ( ) ;
825
- } else if ( connection . socket && connection . socket . address ) {
826
- connectionAddress = connection . socket . address ( )
823
+ if ( connection . remoteAddress ) {
824
+ connectionAddress = {
825
+ remoteAddress : connection . remoteAddress
826
+ , remotePort : connection . remotePort
827
+ } ;
828
+ } else if ( connection . socket && connection . socket . remoteAddress ) {
829
+ connectionAddress = {
830
+ remoteAddress : connection . socket . remoteAddress
831
+ , remotePort : connection . socket . remotePort
832
+ } ;
827
833
}
828
834
829
835
return {
Original file line number Diff line number Diff line change @@ -80,8 +80,8 @@ module.exports = {
80
80
fn ( null , true ) ;
81
81
} )
82
82
. on ( 'connection' , function ( socket ) {
83
- socket . handshake . address . address . should . equal ( '127.0.0.1' ) ;
84
- socket . handshake . address . port . should . equal ( ports ) ;
83
+ ( ! ! socket . handshake . address . remoteAddress ) . should . be . true ;
84
+ ( ! ! socket . handshake . address . remotePort ) . should . be . true ;
85
85
socket . handshake . headers . host . should . equal ( 'localhost' ) ;
86
86
socket . handshake . headers . connection . should . equal ( 'keep-alive' ) ;
87
87
socket . handshake . time . should . match ( / G M T / ) ;
Original file line number Diff line number Diff line change @@ -1493,8 +1493,8 @@ module.exports = {
1493
1493
, ws ;
1494
1494
1495
1495
io . sockets . on ( 'connection' , function ( socket ) {
1496
- socket . handshake . address . address . should . equal ( '127.0.0.1' ) ;
1497
- socket . handshake . address . port . should . equal ( ports ) ;
1496
+ ( ! ! socket . handshake . address . remoteAddress ) . should . be . true ;
1497
+ ( ! ! socket . handshake . address . remotePort ) . should . be . true ;
1498
1498
socket . handshake . headers . host . should . equal ( 'localhost' ) ;
1499
1499
socket . handshake . headers . connection . should . equal ( 'keep-alive' ) ;
1500
1500
socket . handshake . time . should . match ( / G M T / ) ;
You can’t perform that action at this time.
0 commit comments