setIceConfig({iceServers, placement, iceTransportPolicy})


This is part of the Advanced Firewall Control add-on. Please contact Sales to enable this functionality.

Allows for specifying custom TURN servers rather than only using Daily's default TURN servers.

After setting iceConfig as a frame property, it will be necessary to call setIceConfig() periodically so that the iceServers credentials remain valid, in case they are needed for reconnections, or to connect to new peers in peer mode.

It is recommended to use TURN server credentials that are valid for more than one hour, and call setIceConfig() every hour to refresh the credentials, if possible.

Properties that can be set via setIceConfig():

NameTypeDescriptionDefault value
iceServersRTCIceServer[]Each object has the following structure:

urls: string|String[] Required. Single or multiple STUN/TURN URLs.

'username': string Optional. Username for the TURN server(s) specified.

'credential': string Optional. Credential for the TURN server(s) specified.
placement'front' | 'back' | 'replace'Controls how the provided iceServers are included relative to the Daily-provided servers.

'front' means the provided iceServers are included in the array first.

'back' means the Daily-provided servers are included first.

'replace' means that only the provided iceServers are used. Since all known WebRTC implementations will try all included iceServers and pick one based on the lowest RTT, we recommend omitting this property unless using 'replace'.
iceTransportPolicy'all' | 'relay''all' will use all of the candidates.

'relay' will only use relay candidates, such as those passing through a TURN server. See RTCIceTransportPolicy Enum for more information.

Note: Forcing the use of relay candidates is useful for testing, but for most production use cases, the default value of 'all' should be used.

Example object: