Skip to content

Commit 1f33943

Browse files
committed
[fix] connection.socket -> socket for source of x-forwarded-for data
1 parent 66e9820 commit 1f33943

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/node-http-proxy/http-proxy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
130130
//
131131

132132
if (this.enable.xforward && req.connection && req.socket) {
133-
req.headers['x-forwarded-for'] = req.connection.remoteAddress || req.connection.socket.remoteAddress;
133+
req.headers['x-forwarded-for'] = req.connection.remoteAddress || req.socket.remoteAddress;
134134
req.headers['x-forwarded-port'] = req.connection.remotePort || req.socket.remotePort;
135135
req.headers['x-forwarded-proto'] = req.connection.pair ? 'https' : 'http';
136136
}

0 commit comments

Comments
 (0)