mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] connection.socket -> socket for source of x-forwarded-for data
This commit is contained in:
parent
66e982060c
commit
1f33943b23
@ -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';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user