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

Removed dependency on browser cookies to make the site work.

This commit is contained in:
Ylian Saint-Hilaire 2019-01-28 15:47:54 -08:00
parent e6b05f2b4a
commit e6fc96f3f1
50 changed files with 133 additions and 86 deletions

View file

@ -5,11 +5,12 @@
*/
// Construct a MeshServer agent direction object
var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort) {
var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, authCookie) {
var obj = {};
obj.m = module; // This is the inner module (Terminal or Desktop)
module.parent = obj;
obj.meshserver = meshserver;
obj.authCookie = authCookie;
obj.State = 0;
obj.nodeid = null;
obj.socket = null;
@ -31,6 +32,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort) {
obj.Start = function (nodeid) {
var url2, url = window.location.protocol.replace("http", "ws") + "//" + window.location.host + window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/')) + "/meshrelay.ashx?id=" + obj.tunnelid;
//if (serverPublicNamePort) { url2 = window.location.protocol.replace("http", "ws") + "//" + serverPublicNamePort + "/meshrelay.ashx?id=" + obj.tunnelid; } else { url2 = url; }
if ((authCookie != null) && (authCookie != '')) { url += '&auth=' + authCookie; }
obj.nodeid = nodeid;
obj.connectstate = 0;
obj.socket = new WebSocket(url);