Commit 1f33943b authored by Joshua Holbrook's avatar Joshua Holbrook

[fix] connection.socket -> socket for source of x-forwarded-for data

parent 66e98206
...@@ -130,7 +130,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) { ...@@ -130,7 +130,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
// //
if (this.enable.xforward && req.connection && req.socket) { if (this.enable.xforward && req.connection && req.socket) {
req.headers['x-forwarded-for'] = req.connection.remoteAddress || req.connection.socket.remoteAddress; req.headers['x-forwarded-for'] = req.connection.remoteAddress || req.socket.remoteAddress;
req.headers['x-forwarded-port'] = req.connection.remotePort || req.socket.remotePort; req.headers['x-forwarded-port'] = req.connection.remotePort || req.socket.remotePort;
req.headers['x-forwarded-proto'] = req.connection.pair ? 'https' : 'http'; req.headers['x-forwarded-proto'] = req.connection.pair ? 'https' : 'http';
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment