From 5a410ccd5bbd8a2da3f248dc0294b731e9f9a261 Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Thu, 5 Sep 2024 18:31:37 +0100 Subject: [PATCH] properly fix peering #5714 Signed-off-by: Simon Smith --- multiserver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multiserver.js b/multiserver.js index 623baefc..2ab99101 100644 --- a/multiserver.js +++ b/multiserver.js @@ -634,7 +634,7 @@ module.exports.CreateMultiServer = function (parent, args) { peerTunnel.ws2.on('close', function (req) { peerTunnel.parent.parent.debug('peer', 'FTunnel disconnect ' + peerTunnel.serverid); peerTunnel.close(); }); // If a message is received from the peer, Peer ---> Browser (TODO: Pipe this?) - peerTunnel.ws2.on('message', function (msg) { try { peerTunnel.ws2._socket.pause(); peerTunnel.ws1.send(msg, function () { peerTunnel.ws2._socket.resume(); }); } catch (e) { } }); + peerTunnel.ws2.on('message', function (msg, isBinary) { try { peerTunnel.ws2._socket.pause(); peerTunnel.ws1.send((isBinary ? msg : msg.toString('binary')), function () { peerTunnel.ws2._socket.resume(); }); } catch (e) { } }); // Register the connection event peerTunnel.ws2.on('open', function () {