Skip to content
Permalink
Browse files

[fix] fixes #341

  • Loading branch information...
yawnt committed Dec 18, 2013
1 parent 03880d8 commit 97e4600e944b1de3e3984e8e29d09658c02de606
Showing with 9 additions and 2 deletions.
  1. +7 −0 lib/http-proxy/common.js
  2. +1 −1 lib/http-proxy/passes/web-incoming.js
  3. +1 −1 lib/http-proxy/passes/ws-incoming.js
@@ -73,3 +73,10 @@ common.setupSocket = function(socket) {

return socket;
};

common.getPort = function(req) {
var res = req.headers.host.match(/:(\d+)/);
return res ?
res[1] :
req.connection.pair ? '443' : '80' ;
}
@@ -65,7 +65,7 @@ web_o = Object.keys(web_o).map(function(pass) {

var values = {
for : req.connection.remoteAddress || req.socket.remoteAddress,
port : req.connection.remotePort || req.socket.remotePort,
port : common.getPort(req),
proto: req.isSpdy ? 'https' : (req.connection.pair ? 'https' : 'http')
};

@@ -56,7 +56,7 @@ var passes = exports;

var values = {
for : req.connection.remoteAddress || req.socket.remoteAddress,
port : req.connection.remotePort || req.socket.remotePort,
port : common.getPort(req),
proto: req.connection.pair ? 'wss' : 'ws'
};

0 comments on commit 97e4600

Please sign in to comment.
You can’t perform that action at this time.