Last active
December 11, 2024 19:01
-
-
Save swapnilshrikhande/e694ceb7f51a7c4ed2986d6d6a43c4a6 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