Permalink
Browse files

Cache remote address in handshake since it might be lost later.

  • Loading branch information...
1 parent 588af64 commit 15afd3e2c38ee03010d98852a570849e3a9deec2 @rase- rase- committed Jul 19, 2014
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/socket.js
View
@@ -26,7 +26,10 @@ function Socket (id, server, transport, req) {
this.packetsFn = [];
this.sentCallbackFn = [];
this.request = req;
-
+
+ // Cache IP since it might not be in the req later
+ this.remoteAddress = req.connection.remoteAddress;
+
this.checkIntervalTimer = null;
this.upgradeTimeoutTimer = null;
this.pingTimeoutTimer = null;

0 comments on commit 15afd3e

Please sign in to comment.