diff --git a/agents/MeshCentralRouter.exe b/agents/MeshCentralRouter.exe index a6d264eb..1b3ec695 100644 Binary files a/agents/MeshCentralRouter.exe and b/agents/MeshCentralRouter.exe differ diff --git a/agents/MeshCmd-signed.exe b/agents/MeshCmd-signed.exe index 99593c53..995cdfe3 100644 Binary files a/agents/MeshCmd-signed.exe and b/agents/MeshCmd-signed.exe differ diff --git a/agents/MeshCmd64-signed.exe b/agents/MeshCmd64-signed.exe index 0a2275f8..cd39f4e6 100644 Binary files a/agents/MeshCmd64-signed.exe and b/agents/MeshCmd64-signed.exe differ diff --git a/agents/meshcmd.js b/agents/meshcmd.js index 44c19fff..4ebb9a20 100644 --- a/agents/meshcmd.js +++ b/agents/meshcmd.js @@ -2227,7 +2227,8 @@ function OnWebSocket(msg, s, head) { if (this.parent.tunneling == false) { msg = msg.toString(); if ((msg == 'c') || (msg == 'cr')) { - this.parent.tunneling = true; this.pipe(this.parent.tcp); this.parent.tcp.pipe(this); debug(1, "Tunnel active"); + // Pipe the connection, but don't pipe text websocket frames into the TCP socket. + this.parent.tunneling = true; this.pipe(this.parent.tcp, { dataTypeSkip: 1 }); this.parent.tcp.pipe(this); debug(1, "Tunnel active"); } else if ((msg.length > 6) && (msg.substring(0, 6) == 'error:')) { console.log(msg.substring(6)); disconnectTunnel(this.tcp, this, msg.substring(6)); diff --git a/agents/meshcore.js b/agents/meshcore.js index 17a359a6..4eb04587 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -1179,7 +1179,10 @@ function createMeshCore(agent) { // Called when we get data from the server for a TCP relay (We have to skip the first received 'c' and pipe the rest) function onTcpRelayServerTunnelData(data) { - if (this.first == true) { this.first = false; this.pipe(this.tcprelay); } // Pipe Server --> Target + if (this.first == true) { + this.first = false; + this.pipe(this.tcprelay, { dataTypeSkip: 1 }); // Pipe Server --> Target (don't pipe text type websocket frames) + } } function onTunnelClosed() { @@ -2279,6 +2282,13 @@ function createMeshCore(agent) { if (sdp != null) { ws.write({ type: 'answer', ctrlChannel: '102938', sdp: sdp }); } break; } + case 'ping': { + ws.write("{\"ctrlChannel\":\"102938\",\"type\":\"pong\"}"); // Send pong response + break; + } + case 'pong': { // NOP + break; + } case 'rtt': { ws.write({ type: 'rtt', ctrlChannel: '102938', time: obj.time }); break;