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

Much improved MeshAgent and javascript module support.

This commit is contained in:
Ylian Saint-Hilaire 2017-10-04 20:35:52 -07:00
parent 3ca77afac3
commit 66bb176a12
18 changed files with 291 additions and 46 deletions

View file

@ -28,6 +28,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
var agentUpdateBlockSize = 65520;
obj.remoteaddr = obj.ws._socket.remoteAddress;
if (obj.remoteaddr.startsWith('::ffff:')) { obj.remoteaddr = obj.remoteaddr.substring(7); }
ws._socket.setKeepAlive(true, 0); // Set TCP keep alive
// Send a message to the mesh agent
obj.send = function (data) { try { if (typeof data == 'string') { obj.ws.send(new Buffer(data, 'binary')); } else { obj.ws.send(data); } } catch (e) { } }