W3cubDocs

/DOM

RTCIceServer.username

Draft
This page is not complete.

I'm experimenting with structure for pages documenting members of dictionaries. Please contact sheppy with any feedback.

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

The RTCIceServer dictionary's username property is a string which specifies the username to use when authenticating with the ICE server being described.

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

Syntax

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

var username = iceServer.username;

iceServer.username = newUsername;

Example

This example creates a new RTCPeerConnection which will use a TURN server at turnserver.example.org to negotiate connections. Logging into the TURN server will use 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.username' in that specification.
Candidate Recommendation Initial specification.

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support Yes ? 23 ? ? ?
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support No Yes ? 23 ? ? Yes

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer/username