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

Added browser ping/pong settings.

This commit is contained in:
Ylian Saint-Hilaire 2020-05-06 19:23:11 -07:00
parent ffa4a16551
commit b96ababf0b
3 changed files with 16 additions and 0 deletions

View file

@ -46,6 +46,7 @@ var MeshServerCreateControl = function (domain, authCookie) {
var message;
try { message = JSON.parse(e.data); } catch (e) { return; }
if ((typeof message != 'object') || (message.action == 'pong')) { return; }
if (message.action == 'ping') { obj.send({ action: 'pong' }); }
if (message.action == 'close') { if (message.msg) { console.log(message.msg); } obj.Stop(message.cause); return; }
if (obj.trace) { console.log('RECV', message); }
if (obj.onMessage) obj.onMessage(obj, message);