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

Added full agent ping/pong support on SSH/SFTP sessions.

This commit is contained in:
Ylian Saint-Hilaire 2022-05-05 16:16:58 -07:00
parent 93e8f2cdcf
commit 5869782bdf
3 changed files with 61 additions and 28 deletions

View file

@ -186,7 +186,10 @@
socket.onmessage = function (data) {
if (typeof data.data != 'string') return;
if (data.data[0] == '{') {
var json = JSON.parse(data.data);
var json = null;
try { json = JSON.parse(data.data); } catch (ex) { }
if ((json == null) || (typeof json != 'object')) return;
if ((json.ctrlChannel == 102938) && (json.type == 'ping')) { socket.send('{"ctrlChannel":"102938","type":"pong"}'); return; }
switch (json.action) {
case 'connected': { state = 3; updateState(); term.focus(); break; }
case 'sshauth': {