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
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.

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

JavaScript
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".

JavaScript
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 Browser
The definition of 'RTCIceServer.username' in that specification.
Working Draft Initial specification.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) 23 (23)[1] ? ? ?
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? (Yes) 23.0 (23)[1] ? ? ?

[1] Prior to Firefox 23, Firefox only supported STUN connections; TURN support arrived in Firefox 23, along with support for the username property on the RTCIceServer dictionary. Before that, the username was specified in the URL (username@turnserver.example.org for example).

See also

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/rtciceserver/username

Experimental Property Reference RTCIceServer username WebRTC