-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebRTC connection takes 5~10 seconds and multiple ICE TURN servers fail #61
Comments
I'm not seeing any issues with the ICE servers right now... are you still having issues? It looks like most of the errors in your console screenshots are problems connecting to IPFS/libp2p bootstrap nodes which is expected. The IPFS strategy is also usually the slowest to connect. I have seen an issue once where one of the ICE servers goes down and it breaks connection entirely, so that's something I'd like to make more robust. You can specify your own ICE server config in Trystero, passing a list of both STUN and TURN servers (the latter are used for peers that can't connect directly). const room = joinRoom({
appId: 'yourAppId',
rtcConfig: {
iceServers: [
{
urls: 'stun:relay.metered.ca:80'
},
{
urls: 'turn:relay.metered.ca:80',
username: 'your-turn-server-username',
credential: 'your-turn-server-password'
},
{
urls: 'turn:relay.metered.ca:443',
username: 'your-turn-server-username',
credential: 'your-turn-server-password'
},
{
urls: 'turn:relay.metered.ca:443?transport=tcp',
username: 'your-turn-server-username',
credential: 'your-turn-server-password'
}
]
}
}) |
Thanks for your quick reply. I don't think it is related to IPFS, I was able to reproduce this with FireBase and BitTorrent as The response time is 1 second if I use two tabs in the same browser, however when I use two different browsers to connect or an incognito tab I can reproduce the 10 second problem. May I ask which ICE Turn server Trystero uses? Does Trystero use the same default as simple-peer-light? Maybe it is just a coincidence and a temporary issue? |
Yes, same defaults as simple-peer-light: iceServers: [
{
urls: [
'stun:stun.l.google.com:19302',
'stun:global.stun.twilio.com:3478'
]
}
] I'd like to: Let me know if you have ideas/input for either. |
a. I found the following options:
const DEFAULT_CONFIG = {
iceServers: [
{ urls: "stun:stun.l.google.com:19302" },
{
urls: [
"turn:eu-0.turn.peerjs.com:3478",
"turn:us-0.turn.peerjs.com:3478",
],
username: "peerjs",
credential: "peerjsp",
},
],
sdpSemantics: "unified-plan",
};
I recommend looking at option 1 and 3. b. Swapping out
Another thing to consider in the future might be to choose a server closest to the clients location to reduce latency but that will introduce the complexity of this library. I suggest opening a separate issue for that if we want to consider this in the future. |
One thing to note - I'm having bundle issues with simple-peer-light related to esm support. I actually had to fork Trystero and switch the dep to the latest To further complicate things, it looks like |
@rogersanick which bundler are you using? |
@tony1658 - I'm using nextjs + webpack |
Maybe use https://github.com/matallui/artico instead of simple-peer |
Last week my code did work but currently multiple WebRTC signalling server seems to be broken. Which means I can messages send to other peers arrive with a 10 second delay. I assume it may be related to the
simple-peer-light
WebRTC dependency.Code:
Reproducible example:
Expected behaviour:
Users in the same room get an update of the joined users.
Current behaviour:
ICE Turn Server failed. Multiple ICE TURN servers seem to fail until it finally succeeds with a backup server.
Extra details
I've tried different internet networks (Netherlands - EU):
Room providers:
trystero version
OS:
Browsers:
The text was updated successfully, but these errors were encountered: