diff --git a/src/socket.io/index.js b/src/socket.io/index.js index 9274f72222..8144fbc835 100644 --- a/src/socket.io/index.js +++ b/src/socket.io/index.js @@ -40,7 +40,7 @@ Sockets.init = function(server) { }; function onConnection(socket) { - socket.ip = socket.request.connection.remoteAddress; + socket.ip = socket.request.headers['x-forwarded-for'] || socket.request.connection.remoteAddress; logger.io_one(socket, socket.uid);