From 2722eee3e59bb5a3cb8af59f07513c6c9a1ca7fb Mon Sep 17 00:00:00 2001 From: Drew Ewing Date: Fri, 13 May 2022 09:27:23 -0700 Subject: [PATCH] fix(webrtc): add a configurable list of stun servers to wrtc config --- config.ts | 20 ++++++++++++++++++++ libraries/WebRTC/Call.ts | 3 +++ 2 files changed, 23 insertions(+) diff --git a/config.ts b/config.ts index cff650d39b..d5eabeab53 100644 --- a/config.ts +++ b/config.ts @@ -144,6 +144,26 @@ export const Config = { /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i, }, webrtc: { + iceServers: [ + { + urls: 'stun:stun.l.google.com:19302', + }, + { + urls: 'stun:stun2.l.google.com:19302', + }, + { + urls: 'stun:stun3.l.google.com:19302', + }, + { + urls: 'stun:stun4.l.google.com:19302', + }, + { + urls: 'stun:stun.services.mozilla.com', + }, + { + urls: 'stun:stun.services.mozilla.com', + }, + ], constraints: { audio: true, video: { diff --git a/libraries/WebRTC/Call.ts b/libraries/WebRTC/Call.ts index f641cec662..dbcd18929a 100644 --- a/libraries/WebRTC/Call.ts +++ b/libraries/WebRTC/Call.ts @@ -178,6 +178,9 @@ export class Call extends Emitter { offerToReceiveAudio: true, offerToReceiveVideo: true, }, + config: { + iceServers: Config.webrtc.iceServers, + }, }, ) this.peers[peerId] = peer