RTCIceServer.credential

Draft
This page is not complete.

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The RTCIceServer dictionary's credential property is a string providing the credential to use when connecting to the described server. This is typically a password, key, or other secret.

This value is used when the RTCIceServer describes a TURN server.

Syntax

var iceServer = {
                  ...
                  credential = credential,
                  ...
                };

var credential = iceServer.credential;

iceServer.credential = newCredential;

Example

This example creates a new RTCPeerConnection which uses a TURN server at turnserver.example.org to negotiate connections. Logging into the TURN server uses the username "webrtc" and the creative password "turnpassword".

myPeerConnection = new RTCPeerConnection({
  iceServers: [
    {
      urls: "turn:turnserver.example.org",  // A TURN server
      username: "webrtc",
      credential: "turnpassword"
    }
  ]
});

Specifications

Specification Status Comment
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCIceServer.credential' in that specification.
Candidate Recommendation Initial specification.

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
credentialChrome Full support YesEdge Full support ≤79Firefox Full support 22IE No support NoOpera ? Safari ? WebView Android No support NoChrome Android Full support YesFirefox Android Full support 24Opera Android ? Safari iOS ? Samsung Internet Android Full support Yes

Legend

Full support
Full support
No support
No support
Compatibility unknown
Compatibility unknown

See also