Skip to content

Commit

Permalink
feat: add iceServers array to createWebRtcTransport response (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmatau79 authored Sep 24, 2024
1 parent b1514c2 commit d03dfac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
},
ingressHost: process.env.MEDIASOUP_INGRESS_HOST,
},
//IceServer config
//IceServer config deprecated
iceserver: {
enableIceServer: process.env.MEDIASOUP_CLIENT_ENABLE_ICESERVER || 'true',
iceServerHost: process.env.MEDIASOUP_CLIENT_ICESERVER_HOST || 'localhost',
Expand All @@ -32,6 +32,13 @@ module.exports = {
iceServerUser: process.env.MEDIASOUP_CLIENT_ICESERVER_USER || '',
iceServerPass: process.env.MEDIASOUP_CLIENT_ICESERVER_PASS || '',
},
iceServers: [
{
urls: `turn:${process.env.MEDIASOUP_CLIENT_ICESERVER_HOST}:${process.env.MEDIASOUP_CLIENT_ICESERVER_PORT}?transport=${process.env.MEDIASOUP_CLIENT_ICESERVER_PROTO}`,
username: process.env.MEDIASOUP_CLIENT_ICESERVER_USER,
credential: process.env.MEDIASOUP_CLIENT_ICESERVER_PASS
}
],
// mediasoup settings.
mediasoup: {
// Number of mediasoup workers to launch.
Expand Down
3 changes: 2 additions & 1 deletion lib/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,8 @@ class Room extends EventEmitter {
iceCandidates: transport.iceCandidates,
dtlsParameters: transport.dtlsParameters,
sctpParameters: transport.sctpParameters,
iceServer: config.iceserver,
iceserver: config.iceserver, // Deprecated
iceServers: config.iceServers,
})

const { maxIncomingBitrate } = config.mediasoup.webRtcTransportOptions
Expand Down

0 comments on commit d03dfac

Please sign in to comment.