fix peering traffic #5714

Signed-off-by: Simon Smith <simonsmith5521@gmail.com>

Simon Smith committed Sep 5, 2024 at 12:57 UTC 7c79dbcda177845f421287c1dc15e44cc3e97743
1 file changed +1
agents/meshcore.js
+1
@@ -2763,6 +2763,7 @@ function onTunnelData(data)
2763 // Handle tunnel data
2764 if (this.httprequest.protocol == 0) { // 1 = Terminal (admin), 2 = Desktop, 5 = Files, 6 = PowerShell (admin), 7 = Plugin Data Exchange, 8 = Terminal (user), 9 = PowerShell (user), 10 = FileTransfer
2765 // Take a look at the protocol
2766 + if (data[0] == 123) { data = data.toString(); } // convert to string to fix binary data coming from peer servers
2767 if ((data.length > 3) && (data[0] == '{')) { onTunnelControlData(data, this); return; }
2768 this.httprequest.protocol = parseInt(data);
2769 if (typeof this.httprequest.protocol != 'number') { this.httprequest.protocol = 0; }