Skip to content

Instantly share code, notes, and snippets.

@swapnilshrikhande
Last active February 22, 2023 15:15
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swapnilshrikhande/e694ceb7f51a7c4ed2986d6d6a43c4a6 to your computer and use it in GitHub Desktop.
Save swapnilshrikhande/e694ceb7f51a7c4ed2986d6d6a43c4a6 to your computer and use it in GitHub Desktop.
WebTorrent Configure Custom STUN / TURN Server
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