File tree 3 files changed +9
-2
lines changed
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -73,3 +73,10 @@ common.setupSocket = function(socket) {
73
73
74
74
return socket ;
75
75
} ;
76
+
77
+ common . getPort = function ( req ) {
78
+ var res = req . headers . host . match ( / : ( \d + ) / ) ;
79
+ return res ?
80
+ res [ 1 ] :
81
+ req . connection . pair ? '443' : '80' ;
82
+ }
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ web_o = Object.keys(web_o).map(function(pass) {
65
65
66
66
var values = {
67
67
for : req . connection . remoteAddress || req . socket . remoteAddress ,
68
- port : req . connection . remotePort || req . socket . remotePort ,
68
+ port : common . getPort ( req ) ,
69
69
proto : req . isSpdy ? 'https' : ( req . connection . pair ? 'https' : 'http' )
70
70
} ;
71
71
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ var passes = exports;
56
56
57
57
var values = {
58
58
for : req . connection . remoteAddress || req . socket . remoteAddress ,
59
- port : req . connection . remotePort || req . socket . remotePort ,
59
+ port : common . getPort ( req ) ,
60
60
proto : req . connection . pair ? 'wss' : 'ws'
61
61
} ;
62
62
You can’t perform that action at this time.
0 commit comments