unsetbit / p

Peer-to-peer networking with browsers

Home Page:http://unsetbit.com/p

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IceServers for P

AjayRah opened this issue · comments

Hi,

How do I pass iceservers to be used for RTCPeerConnection?

When you're using .connect() you can pass in a rtcConfiguration option like so:

var rtcPeer = onrampPeer.connect({
  address: '<address of peer>',
  rtcConfiguration: {
    iceServers: [
      {url: "stun:stun.l.google.com:19302"},
    ]
  }
});

The rtcConfiguration option is defined here: https://developer.mozilla.org/en-US/docs/Web/API/RTCConfiguration