Added default STUN servers for WebRTC.

This commit is contained in:
Ylian Saint-Hilaire 2020-11-28 10:36:25 -08:00
parent b11b974873
commit 725dc25df2
2 changed files with 4 additions and 1 deletions

View File

@ -99,8 +99,10 @@
"syslogjson": { "type": "string" },
"webrtcConfig": {
"type": "object",
"additionalProperties": false,
"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.",
"properties": {
"iceServers": { "type": "array", "uniqueItems": true, "items": { "type": "object", "properties": { "urls": { "type": "string" } }, "required": [ "urls" ] } }
"iceServers": { "type": "array", "uniqueItems": true, "items": { "type": "object", "additionalProperties": false, "properties": { "urls": { "type": "string" } }, "required": [ "urls" ] } }
},
"required": [ "iceServers" ]
},

View File

@ -1141,6 +1141,7 @@ function CreateMeshCentralServer(config, args) {
if (obj.args.redirport == null) obj.args.redirport = 80;
if (obj.args.minifycore === 0) obj.args.minifycore = false;
if (typeof args.agentidletimeout != 'number') { args.agentidletimeout = 150000; } else { args.agentidletimeout *= 1000 } // Default agent idle timeout is 2m, 30sec.
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
// Setup a site administrator
if ((obj.args.admin) && (typeof obj.args.admin == 'string')) {