is it impossible to make a simple webrtc connection reliably!?
See original GitHub issue simplepeer.min.js:6 Uncaught Error: Connection failed.
at p._onConnectionStateChange (simplepeer.min.js:6)
at RTCPeerConnection._pc.onconnectionstatechange (simplepeer.min.js:6)
happens in all browsers, on all my computers, all of my friends computers, all webrtc projets, and even on localhost. usually it connects fine, but sometimes it just gets stuck.
this is not a bug with simple-peer, this is a bug with webrtc. i came here expecting simple-peer to have retries built in or something to solve this. am i the only person with this issue or does everyone just accept it??? it’s so annoying and has been happening with many projects for many years now. .
even your simple demo where you copy/paste the signals will fail sometimes if you do it enough times.
i dare you to try any webrtc demo about 20 times, it will get stuck.
sorry for venting my frustrations here but i’ve been working on a webrtc project off and on for about 3 years now and i still can’t connect reliably. any help is appreciated
Issue Analytics
- State:
- Created 3 years ago
- Reactions:14
- Comments:7 (1 by maintainers)
Top GitHub Comments
do you know what a TURN server is? that’s literally the “we failed to connect, let’s just give up on p2p and make a normal laggy server relay connection”
no, that’s not a solution i want. especially when it fails to connect at random and uses the TURN server at random. that was actually one of the biggest bugs i had in my app. was why the heck i’m getting 70ms ping on a localhost connection. works way better now that i removed the TURN server
I’ve been studying it since 2018 on my spare time, I saw some people moving to native WebRTC browser API the problems are the same but since you control the code you might not fall into design decisions that are particular to simple-peer.
Honestly, I think simple-peer would be a better lib if it could add CHANGELOG file for release notes, it helps us keep up to date on it overtime. But, I love it and I’m grateful cause I’ve played a lot with WebRTC with it and I get it is hard for maintainers to keep a popular side project like this one.
I haven’t built any corp program with it cause I don’t feel confident using it on comercial products, so this is my toy lab because I just never know when it breaks and it can refuse to connect for many many reasons far away from my ability to understand it hahaha so yeah shout out for you all people, good luck with p2p in 2022 and share all your gotchas publicly so I can find it later and use it as well hopefully.