The WebRTC Device API dictionary RTCConfiguration's iceTransportPolicy property is a string indicating the transport selection policy the ICE agent should use during negotiation of connections.

If this property isn't included in the RTCConfiguration, the default value, all, is used.


let rtcConfiguration = {
  iceTransportPolicy: policy

rtcConfiguration.iceTransportPolicy = policy;
let policy = rtcConfiguration.iceTransportPolicy;


A DOMString which indicates what ICE candidate policy the ICE agent should use during the negotiation process, per the JSEP standard. The permitted values are:


The ICE agent is permitted to use any kind of candidate, including both local and relay candidates. The agent—or the browser itself—may still perform some form of IP filtering on the incoming candidates for reasons including privacy and security, as well as to limit the number of candidates. This is the default.


The ICE agent only considers media relay candidates when evaluating candidates. This includes, for example, those candidates relayed by a STUN or TURN server.

Note: This can be used to prevent the remote endpoint from receiving the user's IP addresses, which may be important in some security situations. For example, in a video calling application, the app may want to prevent unknown callers from learning the callee's IP addresses until the callee has agreed to receive the call.


In this example, a new connection is configured to only accept relay candidates.

let config = {
  iceServers: [
      urls: [ "stun:stun.example.com" ]
  iceTransportPolicy: "relay"

let pc = new RTCPeerConnection(config);


WebRTC 1.0: Real-Time Communication Between Browsers (WebRTC 1.0)
# dom-rtcconfiguration-icetransportpolicy

Browser compatibility

BCD tables only load in the browser