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.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.
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.
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...
(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...
Leaving out the ICE will of course make WebRTC look palatable.
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.