Small server discovery fix

This commit is contained in:
Ylian Saint-Hilaire 2018-09-01 22:32:39 -07:00
parent fa7abefa01
commit 108faa1ac3
2 changed files with 4 additions and 1 deletions

View File

@ -140,11 +140,13 @@ module.exports.CreateMeshScanner = function (parent) {
// Build the IPv4 response
var url = (parent.args.notls ? 'ws' : 'wss') + '://%s:' + parent.args.port + '/agent.ashx';
obj.multicastPacket4 = Buffer.from("MeshCentral2|" + obj.agentCertificateHashHex + '|' + url, 'ascii');
if (parent.certificates.CommonName != "un-configured") { url = (parent.args.notls ? 'ws' : 'wss') + '://' + parent.certificates.CommonName + ':' + parent.args.port + '/agent.ashx'; }
obj.multicastPacket4x = Buffer.from("MeshCentral2|" + obj.agentCertificateHashHex + '|' + url + '|' + name + '|' + info, 'ascii');
// Build the IPv6 response
url = (parent.args.notls ? 'ws' : 'wss') + '://[%s]:' + parent.args.port + '/agent.ashx';
obj.multicastPacket6 = Buffer.from("MeshCentral2|" + obj.agentCertificateHashHex + '|' + url, 'ascii');
if (parent.certificates.CommonName != "un-configured") { url = (parent.args.notls ? 'ws' : 'wss') + '://' + parent.certificates.CommonName + ':' + parent.args.port + '/agent.ashx'; }
obj.multicastPacket6x = Buffer.from("MeshCentral2|" + obj.agentCertificateHashHex + '|' + url + '|' + name + '|' + info, 'ascii');
setupServers();

View File

@ -14,7 +14,8 @@
"_AllowFraming": true,
"_WebRTC": false,
"_ClickOnce": false,
"_UserAllowedIP" : "127.0.0.1,::1,192.168.0.100"
"_UserAllowedIP": "127.0.0.1,::1,192.168.0.100",
"_LocalDiscovery": { "name": "Local server name", "info": "Information about this server" }
},
"_domains": {
"": {