Permalink
Browse files

Merge pull request #270 from rase-/cache-ip-in-handshake

Cache remote address in handshake since it might be lost later.
  • Loading branch information...
2 parents 588af64 + 15afd3e commit f00ef8b284507308fbb9e1daaa4923d303aa4d3d @rauchg rauchg 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 f00ef8b

Please sign in to comment.