Hi Feross, just a question here, what about to set multiple stun servers for high availability?
You can pass those as part of your options (see iceServers) below. The following example was trimmed down from the README.
peer = new Peer({
initiator: false,
config: { iceServers: [{ urls: 'stun:stun.l.google.com:19302' }, { urls: 'stun:global.stun.twilio.com:3478?transport=udp' }] }
});
Use the config option. Each element in config.iceServers is a "grouping" of redundant server urls. They should be backups for each other.
new Peer({
config: {iceServers: [
{urls: [
'stun:stun.a-primary.com:19302',
'stun:stun.a-secondary.com:19302',
'stun:stun.a-backup.com:19302'
]},
{urls: [
'stun:stun.b-primary.com:19302',
'stun:stun.b-secondary.com:19302',
'stun:stun.b-backup.com:19302'
]},
{
username: "webrtc",
credential: "turnpassword"
urls: [
'turn:turn.a-primary.com:19302',
'turn:turn.a-secondary.com:19302',
'turn:turn.a-backup.com:19302'
]}
]}
})
@jarretttaylor While that will work and is correct when stun servers can potentially give different candidates, redundant/backup servers should be specified in the same urls array (so you only query one of them).
Thanks mate :)