diff --git a/agents/MeshCentralAssistant.exe b/agents/MeshCentralAssistant.exe index 89f5312e..1160a721 100644 Binary files a/agents/MeshCentralAssistant.exe and b/agents/MeshCentralAssistant.exe differ diff --git a/agents/MeshCentralRouter.exe b/agents/MeshCentralRouter.exe index 8c268f93..0dd12940 100644 Binary files a/agents/MeshCentralRouter.exe and b/agents/MeshCentralRouter.exe differ diff --git a/agents/MeshCmd-signed.exe b/agents/MeshCmd-signed.exe index 539c87a8..66a99f38 100644 Binary files a/agents/MeshCmd-signed.exe and b/agents/MeshCmd-signed.exe differ diff --git a/agents/MeshCmd64-signed.exe b/agents/MeshCmd64-signed.exe index e15d5a3c..11fd3f6c 100644 Binary files a/agents/MeshCmd64-signed.exe and b/agents/MeshCmd64-signed.exe differ diff --git a/meshagent.js b/meshagent.js index 8b8133d8..84f26027 100644 --- a/meshagent.js +++ b/meshagent.js @@ -1498,8 +1498,14 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) { if (typeof command.name != 'string') break; var info = parent.parent.meshToolsBinaries[command.name]; if ((command.hash != null) && (info.hash == command.hash)) return; + + // To build the connection URL, if we are using a sub-domain or one with a DNS, we need to craft the URL correctly. + var xdomain = (domain.dns == null) ? domain.id : ''; + if (xdomain != '') xdomain += '/'; + + // Build the response const responseCmd = { action: 'meshToolInfo', name: command.name, tag: command.tag, sessionid: command.sessionid, hash: info.hash, size: info.size, url: info.url }; - if ((command.name == 'MeshCentralAssistant') && (command.msh == true)) { responseCmd.url = "*/meshagents?id=10006"; } // If this is Assistant and the MSH needs to be included in the executable, change the URL. + if ((command.name == 'MeshCentralAssistant') && (command.msh == true)) { responseCmd.url = '*/' + xdomain + 'meshagents?id=10006'; } // If this is Assistant and the MSH needs to be included in the executable, change the URL. if (command.cookie === true) { responseCmd.url += ('&auth=' + parent.parent.encodeCookie({ download: info.dlname }, parent.parent.loginCookieEncryptionKey)); } if (command.pipe === true) { responseCmd.pipe = true; } if (parent.webCertificateHashs[domain.id] != null) { responseCmd.serverhash = Buffer.from(parent.webCertificateHashs[domain.id], 'binary').toString('hex'); }