Properties

If the RTCIceServer represents a TURN server, this attribute specifies what kind of credential is to be used when connecting. This must be one of the values defined by the RTCIceCredentialType enum. The default is "password".

This obsolete property is a string specifies a single ICE server's URL. Do not use this property; use RTCIceServer.urls instead. Because many older books and examples still use this, we include it to help developers update their code or make sense of older examples.

If the RTCIceServer is a TURN server, then this is the username to use during the authentication process.

Avoid specifying an unnecessarily large number of URLs in the urls property; the startup time for your connection will go up substantially. Every server in the list will be contacted and tried out before one is selected to be used for negotiation.

Older versions of the WebRTC specification included an url property instead of urls; this was changed in order to let you specify multiple addresses for each server in the list, as shown in the example below.

Constants

RTCIceCredentialType enum

The RTCIceCredentialType enum specifies values which can be returned by the credentialType property to define what kind of authentication credential is being provided in the RTCIceServer.credential property. This can be one of the values below.

Constant

Description

"password"

The credential is a long-term authentication password. See RFC 5389, section 10.2 for further details on this type of credential.

"token"

The credential is an access token to be used with a third-party authentication system.

Example

The configuration below establishes two ICE servers. The first one, stun:stun.services.mozilla.com, requires authentication, so the username and password are provided. The second server has two URLs: stun:stun.example.com and stun:stun-1.example.com.