1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Do not dynamically add/remove upgrade listener in ws nodes

The way we dynamically added/removed event handlers for the
upgrade event was causing problems with the way sockjs (as
used by the worldmap node) tries to intercept the event.

This fix means the ws nodes won't ever remove the upgrade
listener - it gets added once when the first ws node is
deployed and will then remain until the last ws node is
removed and the runtime restarted.
This commit is contained in:
Nick O'Leary 2019-03-20 14:58:26 +00:00
parent ee6c6266cc
commit a3cbe80a36
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -141,10 +141,10 @@ module.exports = function(RED) {
node.server.close();
node._inputNodes = [];
activeListenerNodes--;
if (activeListenerNodes === 0 && serverUpgradeAdded) {
RED.server.removeListener('upgrade', handleServerUpgrade);
serverUpgradeAdded = false;
}
// if (activeListenerNodes === 0 && serverUpgradeAdded) {
// RED.server.removeListener('upgrade', handleServerUpgrade);
// serverUpgradeAdded = false;
// }
}