-
-
Save nichoth/89fe180af4d93685b31c04b73e68c12f to your computer and use it in GitHub Desktop.
WebTorrent Configure Custom STUN / TURN Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var client = window.client = new WebTorrent({ | |
tracker: { | |
rtcConfig: rtcConfig | |
} | |
}) | |
client.on('warning', onWarning) | |
client.on('error', onError) | |
torrent = client.add(TORRENT, onTorrent) | |
rtcConfig = | |
{ | |
"iceServers": [{ | |
"urls": "stun:23.21.150.121" | |
}, { | |
"username": "xxx", | |
"credential": "xxx", | |
"urls": "turn:global.turn.twilio.com:3478?transport=udp" | |
}, { | |
"username": "xxx", | |
"credential": "xxx", | |
"urls": "turn:global.turn.twilio.com:3478?transport=tcp" | |
}, { | |
"username": "xxxx", | |
"credential": "xxx", | |
"urls": "turn:global.turn.twilio.com:443?transport=tcp" | |
}] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment