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

First attempt at MSTSC.js support.

This commit is contained in:
Ylian Saint-Hilaire 2020-06-09 18:17:15 -07:00
parent c7cb610f92
commit b7f09f32f8
17 changed files with 28363 additions and 1235 deletions

View file

@ -2157,6 +2157,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
if (domain.sessionrecording != null) { features += 0x08000000; } // Server recordings enabled
if (domain.urlswitching === false) { features += 0x10000000; } // Disables the URL switching feature
if (domain.novnc === false) { features += 0x20000000; } // Disables noVNC
if (domain.mstsc !== true) { features += 0x40000000; } // Disables MSTSC.js
// Create a authentication cookie
const authCookie = obj.parent.encodeCookie({ userid: user._id, domainid: domain.id, ip: req.clientIp }, obj.parent.loginCookieEncryptionKey);
@ -4342,6 +4343,15 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
obj.app.get(url + 'pluginHandler.js', obj.handlePluginJS);
}
// Setup MSTSC.js if needed
if (domain.mstsc === true) {
obj.app.ws(url + 'mstsc/relay.ashx', function (ws, req) {
PerformWSSessionAuth(ws, req, false, function (ws1, req1, domain, user) {
require('./mstsc.js').CreateMstscRelay(obj, obj.db, ws1, req1, obj.args, domain, user);
});
});
}
// Setup auth strategies using passport if needed
if (typeof domain.authstrategies == 'object') {
const passport = domain.passport = require('passport');