From: Darren Date: Wed, 4 Jun 2014 14:49:37 +0000 (+0100) Subject: engine.io fix for "forgetting" remoteAddress on websockets X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fdec8078fcf34ce28ee58d8c69afcba223a66568;p=KiwiIRC.git engine.io fix for "forgetting" remoteAddress on websockets --- diff --git a/server/weblistener.js b/server/weblistener.js index 02bdca3..fcaeb7c 100644 --- a/server/weblistener.js +++ b/server/weblistener.js @@ -75,6 +75,11 @@ var WebListener = module.exports = function (web_config) { this.ws = new engine.Server(); hs.on('upgrade', function(req, socket, head){ + // engine.io can sometimes "loose" the clients remote address. Keep note of it + req.meta = { + remote_address: req.connection.remoteAddress + }; + that.ws.handleUpgrade(req, socket, head); });