fixed real address grabbing
This commit is contained in:
parent
8f0651e3a0
commit
4296ad20c8
|
@ -130,10 +130,10 @@ function log_request(req, res, time) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_real_address(req) {
|
function get_real_address(req) {
|
||||||
if (TRUSTED_PROXIES.indexOf(req.socket.localAddress) !== -1 && req.headers['x-forwarded-for']) {
|
if (TRUSTED_PROXIES.indexOf(req.connection.remoteAddress) !== -1 && req.headers['x-forwarded-for']) {
|
||||||
return req.headers['x-forwarded-for'];
|
return req.headers['x-forwarded-for'];
|
||||||
}
|
}
|
||||||
return req.socket.localAddress;
|
return req.connection.remoteAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
const wss = new Websocket.Server({ server });
|
const wss = new Websocket.Server({ server });
|
||||||
|
|
Loading…
Reference in a new issue