Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upSTUN or TURN servers #283
STUN or TURN servers #283
Comments
This comment has been minimized.
This comment has been minimized.
|
In the browser, WebTorrent uses So, by default, WebTorrent won't use TURN (relay servers) since they can be expensive and aren't freely run by anyone. STUN, on the other hand, is required to establish webrtc connections. You can specify your own STUN/TURN servers like this: var rtcConfig = {
iceServers: [
{"url":"stun:xx.xx.xx.xx"},
{"url":"turn:xx.xx.xx.xx","username":"beep","credential":"boop"}
]
}
new WebTorrent({ rtcConfig: rtcConfig })And, indeed, this is what https://instant.io is doing, since it uses a TURN relay server to increase reliability. This makes sense for a use-case like 1-to-1 or few-to-few file sharing, where any two peers MUST be able to connect. But for the general WebTorrent case, it doesn't make sense to use TURN since if you can't connect to some peers, it isn't the end of the world – you can always just connect to others. |
Is there a certain list of STUN or TURN servers do you use in your implementation? im using wireshark and i can see in some cases there is a TURN connections to some ips addresses for https://instant.io/. Are these servers for free? are yours? is possible to have my own list of servers and tell the webtorrent API to connect to it?