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

Added Intel AMT tunneling configuration support.

This commit is contained in:
Ylian Saint-Hilaire 2020-10-17 19:23:24 -07:00
parent b555fcbe43
commit fd8265313d
8 changed files with 709 additions and 109 deletions

View file

@ -285,6 +285,9 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
socket.SetupChannel.parent = obj;
socket.SetupChannel.conn = socket;
socket.websocket = 1;
socket.ControlMsg = function ControlMsg(message) { return ControlMsg.parent.SendJsonControl(ControlMsg.conn, message); }
socket.ControlMsg.parent = obj;
socket.ControlMsg.conn = socket;
parent.debug('mps', "New CIRA websocket connection");
socket.on('message', function (data) {
@ -913,6 +916,13 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) {
for (var i in connections) { obj.close(connections[i]); }
};
obj.SendJsonControl = function(socket, data) {
if (socket.tag.connType == 0) return; // This command is valid only for connections that are not really CIRA.
parent.debug('mpscmd', '<-- JSON_CONTROL');
if (typeof data == 'object') { data = JSON.stringify(data); }
Write(socket, String.fromCharCode(APFProtocol.JSON_CONTROL) + common.IntToStr(data.length) + data);
}
function SendServiceAccept(socket, service) {
parent.debug('mpscmd', '<-- SERVICE_ACCEPT', service);
Write(socket, String.fromCharCode(APFProtocol.SERVICE_ACCEPT) + common.IntToStr(service.length) + service);