diff --git a/lib/manager.js b/lib/manager.js index 5362b30338..e9c20c249e 100644 --- a/lib/manager.js +++ b/lib/manager.js @@ -807,8 +807,12 @@ Manager.prototype.handleHandshake = function (data, req, res) { Manager.prototype.handshakeData = function (data) { var connection = data.request.connection , connectionAddress; - - if (connection.remoteAddress) { + if (data.request.headers['x-forwarded-for']) { + connectionAddress = { + address: data.request.headers['x-forwarded-for'], + port: data.request.headers['x-forwarded-port'] || 80 + }; + } else if (connection.remoteAddress) { connectionAddress = { address: connection.remoteAddress , port: connection.remotePort