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

Improved executable binary handling

This commit is contained in:
Ylian Saint-Hilaire 2018-01-19 18:04:54 -08:00
parent 4106b322d6
commit 65f99a3c31
11 changed files with 410 additions and 64 deletions

View file

@ -279,12 +279,12 @@ function startLms() {
//console.log("WebSocket for " + req.url.split('?')[0]);
switch (req.url.split('?')[0]) {
case '/lms.ashx': // MeshCommander control channel (PTHI)
socket.upgradeWebSocket();
socket.on('data', processLmsControlData);
socket.ws = socket.upgradeWebSocket();
socket.ws.on('data', processLmsControlData);
break;
case '/webrelay.ashx': // MeshCommander data channel (LME)
socket.upgradeWebSocket();
amtLms.bindDuplexStream(socket, 'IPv4', 16992);
socket.ws = socket.upgradeWebSocket();
amtLms.bindDuplexStream(socket.ws, 'IPv4', 16992);
break;
default:
socket.end();
@ -295,9 +295,8 @@ function startLms() {
//console.log("WebRequest for " + req.url.split('?')[0]);
switch (req.url.split('?')[0]) {
case '/': // Serve MeshCommander Web Application for LMS
rsp.writeHead(200, 'OK', { Server: 'JSLMS', 'Cache-Control': 'max-age=0, no-cache', 'X-Frame-Options': 'DENY', 'Content-Type': 'text/html', 'Content-Encoding': 'gzip', ETag: _IntelAmtWebApp_etag });
rsp.write(Buffer.from(_IntelAmtWebApp, 'base64'));
rsp.end();
rsp.writeHead(200, 'OK', { Server: 'JSLMS', 'Cache-Control': 'max-age=0, no-cache', 'X-Frame-Options': 'DENY', 'Content-Type': 'text/html', 'Content-Encoding': 'gzip', 'Transfer-Encoding': 'chunked', ETag: _IntelAmtWebApp_etag });
rsp.end(Buffer.from(_IntelAmtWebApp, 'base64'));
break;
default: // Unknown request
rsp.statusCode = 404;