1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

fix webrtcconfig and allow stun servers #6309

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2024-09-03 13:42:06 +01:00
parent 7b48e3b5f5
commit ac0d805378
5 changed files with 27 additions and 7 deletions

View file

@ -23,6 +23,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
obj.ctrlMsgAllowed = true;
obj.attemptWebRTC = false;
obj.webRtcActive = false;
obj.webrtcconfig = null;
obj.webSwitchOk = false;
obj.webchannel = null;
obj.webrtc = null;
@ -158,7 +159,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au
if (obj.attemptWebRTC == true) {
// Try to get WebRTC setup
var configuration = null; //{ "iceServers": [ { 'urls': 'stun:stun.services.mozilla.com' }, { 'urls': 'stun:stun.l.google.com:19302' } ] };
var configuration = obj.webrtcconfig; //{ "iceServers": [ { 'urls': 'stun:stun.cloudflare.com:3478' }, { 'urls': 'stun:stun.l.google.com:19302' } ] };
if (typeof RTCPeerConnection !== 'undefined') { obj.webrtc = new RTCPeerConnection(configuration); }
else if (typeof webkitRTCPeerConnection !== 'undefined') { obj.webrtc = new webkitRTCPeerConnection(configuration); }
if ((obj.webrtc != null) && (obj.webrtc.createDataChannel)) {