From f5955a54b67a0394f7261ec5128070e1540cec95 Mon Sep 17 00:00:00 2001 From: Lucas Barrena Date: Mon, 5 Feb 2024 01:07:41 -0300 Subject: [PATCH] Add option for custom ice servers --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 131eccf..1cc9400 100644 --- a/index.js +++ b/index.js @@ -5,13 +5,13 @@ const safetyCatch = require('safety-catch') const WebStream = require('./lib/web-stream.js') // TODO: Investigate how to deploy STUN servers -const iceServers = [ +const ICES = [ { urls: 'stun:stun.l.google.com:19302' } ] module.exports = class WebPeer { - constructor (relay) { - this._rtc = new RTCPeerConnection({ iceServers }) + constructor (relay, opts = {}) { + this._rtc = new RTCPeerConnection({ iceServers: opts.iceServers || ICES }) this._relay = relay this._mux = Protomux.from(relay)