Small server discovery fix
Ylian Saint-Hilaire committed
Sep 1, 2018 at 22:32 UTC
108faa1ac3f49b92d9cb4aa905b9c2293e3bdf8e
2 files changed
+4
-1
meshscanner.js
+2
@@ -140,11 +140,13 @@ module.exports.CreateMeshScanner = function (parent) {
140
// Build the IPv4 response
141
var url = (parent.args.notls ? 'ws' : 'wss') + '://%s:' + parent.args.port + '/agent.ashx';
142
obj.multicastPacket4 = Buffer.from("MeshCentral2|" + obj.agentCertificateHashHex + '|' + url, 'ascii');
143
+ if (parent.certificates.CommonName != "un-configured") { url = (parent.args.notls ? 'ws' : 'wss') + '://' + parent.certificates.CommonName + ':' + parent.args.port + '/agent.ashx'; }
144
obj.multicastPacket4x = Buffer.from("MeshCentral2|" + obj.agentCertificateHashHex + '|' + url + '|' + name + '|' + info, 'ascii');
145
146
// Build the IPv6 response
147
url = (parent.args.notls ? 'ws' : 'wss') + '://[%s]:' + parent.args.port + '/agent.ashx';
148
obj.multicastPacket6 = Buffer.from("MeshCentral2|" + obj.agentCertificateHashHex + '|' + url, 'ascii');
149
+ if (parent.certificates.CommonName != "un-configured") { url = (parent.args.notls ? 'ws' : 'wss') + '://' + parent.certificates.CommonName + ':' + parent.args.port + '/agent.ashx'; }
150
obj.multicastPacket6x = Buffer.from("MeshCentral2|" + obj.agentCertificateHashHex + '|' + url + '|' + name + '|' + info, 'ascii');
151
152
setupServers();
sample-config.json
+2
-1
@@ -14,7 +14,8 @@
14
"_AllowFraming": true,
15
"_WebRTC": false,
16
"_ClickOnce": false,
17
- "_UserAllowedIP" : "127.0.0.1,::1,192.168.0.100"
17
+ "_UserAllowedIP": "127.0.0.1,::1,192.168.0.100",
18
+ "_LocalDiscovery": { "name": "Local server name", "info": "Information about this server" }
19
},
20
"_domains": {
21
"": {