Removed any ping/pong on MSTSC channel.

Ylian Saint-Hilaire committed Apr 1, 2021 at 11:39 UTC f37d0abddab97841ec8c97238c9c67f61047cacc
3 files changed +7 -5
meshrelay.js
+5 -3
@@ -299,9 +299,11 @@ function CreateMeshRelayEx(parent, ws, req, domain, user, cookie) {
299 // Remove the timeout
300 if (relayinfo.timeout) { clearTimeout(relayinfo.timeout); delete relayinfo.timeout; }
301
302 - // Setup the agent PING/PONG timers
303 - if ((typeof parent.parent.args.agentping == 'number') && (obj.pingtimer == null)) { obj.pingtimer = setInterval(sendPing, parent.parent.args.agentping * 1000); }
304 - else if ((typeof parent.parent.args.agentpong == 'number') && (obj.pongtimer == null)) { obj.pongtimer = setInterval(sendPong, parent.parent.args.agentpong * 1000); }
302 + // Setup the agent PING/PONG timers unless requested not to
303 + if ((obj.req.query.noping != 1) && (obj.peer.req != null) && (obj.peer.req.query != null) && (obj.peer.req.query.noping != 1)) {
304 + if ((typeof parent.parent.args.agentping == 'number') && (obj.pingtimer == null)) { obj.pingtimer = setInterval(sendPing, parent.parent.args.agentping * 1000); }
305 + else if ((typeof parent.parent.args.agentpong == 'number') && (obj.pongtimer == null)) { obj.pongtimer = setInterval(sendPong, parent.parent.args.agentpong * 1000); }
306 + }
307
308 // Setup session recording
309 var sessionUser = obj.user;
mstsc.js
+1 -1
@@ -67,7 +67,7 @@ module.exports.CreateMstscRelay = function (parent, db, ws, req, args, domain) {
67 if (args.tlsoffload) { protocol = 'ws'; }
68 var domainadd = '';
69 if ((domain.dns == null) && (domain.id != '')) { domainadd = domain.id + '/' }
70 - var url = protocol + '://127.0.0.1:' + args.port + '/' + domainadd + 'meshrelay.ashx?auth=' + obj.infos.ip;
70 + var url = protocol + '://127.0.0.1:' + args.port + '/' + domainadd + 'meshrelay.ashx?noping=1&auth=' + obj.infos.ip;
71 parent.parent.debug('relay', 'RDP: Connection websocket to ' + url);
72 obj.wsClient = new WebSocket(url, options);
73 obj.wsClient.on('open', function () { parent.parent.debug('relay', 'RDP: Relay websocket open'); });
public/mstsc/client.js
+1 -1
@@ -150,7 +150,7 @@
150 connect : function (ip, domain, username, password, next) {
151 // Start connection
152 var self = this;
153 - this.socket = new WebSocket("wss://" + window.location.host + "/mstsc/relay.ashx");
153 + this.socket = new WebSocket('wss://' + window.location.host + '/mstsc/relay.ashx');
154 this.socket.binaryType = 'arraybuffer';
155 this.socket.onopen = function () {
156 //console.log("WS-OPEN");