1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Web relay text/event-stream improvement (#4369) and relay disconnect fix.

This commit is contained in:
Ylian Saint-Hilaire 2022-08-05 15:39:11 -07:00
parent 046dd30786
commit fe24dccd8c
3 changed files with 20 additions and 11 deletions

View file

@ -296,7 +296,8 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
//obj.debug('Agent Redir Socket Stopped');
obj.connectstate = -1;
if (obj.socket != null) {
try { if (obj.socket.readyState == 1) { obj.sendCtrlMsg('{"ctrlChannel":"102938","type":"close"}'); obj.socket.close(); } } catch (e) { }
try { if (obj.socket.readyState == 1) { obj.sendCtrlMsg('{"ctrlChannel":"102938","type":"close"}'); } } catch (ex) { } // If connected, send the close command
try { if (obj.socket.readyState <= 1) { obj.socket.close(); } } catch (ex) { } // If connecting or connected, close the websocket
obj.socket = null;
}
obj.xxStateChange(0);