Added default STUN servers for WebRTC.
Ylian Saint-Hilaire committed
Nov 28, 2020 at 10:36 UTC
725dc25df2f8b918337b309ac93d66a6c9a768fb
2 files changed
+4
-1
meshcentral-config-schema.json
+3
-1
@@ -99,8 +99,10 @@
99
"syslogjson": { "type": "string" },
100
"webrtcConfig": {
101
"type": "object",
102
+ "additionalProperties": false,
103
+ "description": "The STUN servers used for WebRTC, if not specified the Google and Mozilla servers and used when the server is not in LAN mode.",
104
"properties": {
103
- "iceServers": { "type": "array", "uniqueItems": true, "items": { "type": "object", "properties": { "urls": { "type": "string" } }, "required": [ "urls" ] } }
105
+ "iceServers": { "type": "array", "uniqueItems": true, "items": { "type": "object", "additionalProperties": false, "properties": { "urls": { "type": "string" } }, "required": [ "urls" ] } }
106
},
107
"required": [ "iceServers" ]
108
},
meshcentral.js
+1
@@ -1141,6 +1141,7 @@ function CreateMeshCentralServer(config, args) {
1141
if (obj.args.redirport == null) obj.args.redirport = 80;
1142
if (obj.args.minifycore === 0) obj.args.minifycore = false;
1143
if (typeof args.agentidletimeout != 'number') { args.agentidletimeout = 150000; } else { args.agentidletimeout *= 1000 } // Default agent idle timeout is 2m, 30sec.
1144
+ if ((obj.args.lanonly != true) && (obj.args.webrtconfig == null)) { obj.args.webrtconfig = { iceservers: [{ urls: 'stun:stun.l.google.com:19302' }, { urls: 'stun:stun.services.mozilla.com' }] }; } // Setup default WebRTC STUN servers
1145
1146
// Setup a site administrator
1147
if ((obj.args.admin) && (typeof obj.args.admin == 'string')) {