From 50dd0982a426dae8b1e4403c72236a0d34a1340b Mon Sep 17 00:00:00 2001 From: calzoneman Date: Wed, 20 Aug 2014 11:44:37 -0500 Subject: [PATCH] Fix IP extraction for socket.io --- lib/io/ioserver.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/io/ioserver.js b/lib/io/ioserver.js index fed1e703..72ef6ff8 100644 --- a/lib/io/ioserver.js +++ b/lib/io/ioserver.js @@ -126,8 +126,7 @@ function addTypecheckedFunctions(sock) { * Called after a connection is accepted */ function handleConnection(sock) { - var ip = sock.handshake.address.address; - var sockUser = sock.handshake.user; + var ip = sock.request.connection.remoteAddress; if (net.isIPv6(ip)) { ip = util.expandIPv6(ip); }