From fdec8078fcf34ce28ee58d8c69afcba223a66568 Mon Sep 17 00:00:00 2001 From: Darren Date: Wed, 4 Jun 2014 15:49:37 +0100 Subject: [PATCH] engine.io fix for "forgetting" remoteAddress on websockets --- server/weblistener.js | 5 +++++ 1 file changed, 5 insertions(+) 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); }); -- 2.25.1