Skip to content

Commit

Permalink
[fix] connection.socket -> socket for source of x-forwarded-for data
Browse files Browse the repository at this point in the history
  • Loading branch information
jfhbrook committed Sep 20, 2011
1 parent 66e9820 commit 1f33943
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/node-http-proxy/http-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down

0 comments on commit 1f33943

Please sign in to comment.