From 1f33943b231cdf2cb619977801c7b0d4e98ab6df Mon Sep 17 00:00:00 2001 From: Joshua Holbrook Date: Tue, 20 Sep 2011 14:34:03 -0700 Subject: [PATCH] [fix] connection.socket -> socket for source of x-forwarded-for data --- lib/node-http-proxy/http-proxy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node-http-proxy/http-proxy.js b/lib/node-http-proxy/http-proxy.js index 84ba1ac..faf133f 100644 --- a/lib/node-http-proxy/http-proxy.js +++ b/lib/node-http-proxy/http-proxy.js @@ -130,7 +130,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) { // 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-proto'] = req.connection.pair ? 'https' : 'http'; }