STUN, TURN, and ICE are a few technologies you need to understand to get started with WebRTC. I'd guess most folks aren't familiar when first looking into it.
The complexity is worth it if you're determined to push most bandwidth costs to clients like I am.
If you want near 100% connectivity at a lower complexity, WebSockets are almost always preferred.
This is just not something you run into with WebSockets.
I'd recommend simple-peer for anyone who does choose to use WebRTC. The maintainers are usually able to smooth these issues out in a reasonable timeframe. <3
We tried to do it, but the IETF event was cancelled https://twitter.com/steely_glint/status/1230447935307026432. I am hoping that in the next 6 months we can have something like that so that all the WebRTC implementations will work together a lot better.
As for "too many protocols": QUIC is already in the browser. This is just giving you an API to it. Think of it like WebSockets for the HTTP3 world.
channel = new RTCPeerConnection().createDataChannel("foo", {ordered: false})
Then you can read from it with: channel.onopen = () => { ... }
channel.onmessage = (event) => { ... }
This is widely supported in every modern browser.(The main issue, and this has nothing to do with the client API, is that WebRTC implementations tend to end up assuming unique ports for each user--which would be needed to help with NAT--but if you aren't behind NAT then the ICE layer already has a connection ID so you should be able to multiplex them all over a single open port.)
I am really excited for DTLS connection ids[0] to land. Then you will have everything you need to run ICE+DTLS (and SCTP over that) and be able to demux/load balance it easier.
[0] https://datatracker.ietf.org/doc/draft-ietf-tls-dtls-connect...
https://bloggeek.me/turn-public-ip-address/
To be perfectly honest, I'm still fuzzy on the why, but numerous blog posts, stack overflow questions, and the Kurento forums agree. This being Hacker News maybe someone with chime in with the technical reasoning.
ICE TCP did get a little more limited recently in Chromium though [0] because of the TCP port scanning issue [1]
I have also heard that some gateways/firewalls/$x don't allow any non-TLS traffic, so you can't even establish ICE. In those cases the DTLS/TLS transport of TURN is nice.
[0] https://lists.w3.org/Archives/Public/public-webrtc/2020Feb/0...
[1] https://medium.com/tenable-techblog/using-webrtc-ice-servers...
STUN and TURN allow the negotiation to include services outside the local network so that you can relay signaling and stream data to a set of endpoints that both peers can use to communicate with one another. This could be the peers directly or it could be a set of 3rd party servers run by Google or someone open to the public and you can't assume any particular network topology.
When Bernard published the QuicTransport stuff I tried a few different versions and it only worked aioquic[0] (which is a really fantastic implementation)! But with 29 drafts and most servers not supporting them all feels like we still have some time to go.
So QUIC as a server is much less likely to happen then ICE/DTLS/SCTP which have implementations that work everywhere.
No, it rather sounds like you have a hammer called WebRTC and you're attempting to use it on a nail called "bidirectional server/client communication".
Why deal with the complex protocol stack of WebRTC which solves, among other things, NAT traversal, mutual authentication and encryption independently of server certificates, multiplexing of data and A/V content on a single port and much more. And I say that as someone who absolutely loves WebRTC for A/V and secure P2P use cases.
There is a true gap of "UDP for the web", which this fills.
"WebSockets over UDP" don't need to be built on QUIC, but I'm assuming by the time you have added all the security features needed to make this as secure as WebSockets for web apps, you'll effectively end up with something equivalent.
Leaving out the ICE will of course make WebRTC look palatable.
It's a simpler spec to solve a simpler problem. WebRTC is necessarily complex, but still overkill for a bunch of scenarios.
EDIT: bizarrely, I found this article on The Verge more descriptive of what metastream does than the website, WIKI and source code :-) [1].
1: https://www.theverge.com/2020/3/25/21191604/watch-movies-fri...