4 ms·
You can already do this with WebRTC, you just need and implementation that won't fall back to TCP if the UDP negotiation fails.
by vvanders 7y ago
You can already do this with WebRTC, you just need and implementation that won't fall back to TCP if the UDP negotiation fails.
- penagwin 7y agoWait webrtc uses udp? Is this new? I thought there was no way to send udp packets through client side Javascript?
- vvanders 7y agoYup, it's been a while since I read the spec but I believe it leaves the transport up to what can be negotiated for maximum compatibility. If you handle the SDP and SCTP handshake you can force it to only use UDP via SCTP. Chrome and FF both support it today.
- mr_luc 7y agoYeah with WebRTC data channels can be UDP! It's just -- and this may be mildly out of date -- EXTREMELY hard to find a server-side setup that will let you do all of what the browsers now support with WebRTC. My recollection from the last time I skipped across this topic was: there are 1 or 2 heavyweight open source projects that mostly focus on the video aspects but also supported data channel stuff, and then one lightweight C and one lightweight Go project that supported everything, and you were mostly out of luck otherwise. I remember the last time I checked, a year ago or so, pieces of what's required being worked on in recent OTP releases in BEAM-land. Hmmm ... time to check again.
- fulafel 7y agoThere is no raw udp or tcp access from browser js, just higher lwvel protocols that are implemented over tcp or udp.
- mypalmike 7y agoJust strip out TCP ICE candidates from the SDP and it won't use TCP.
- zemo 7y agohave you ever actually done this? I don't mean to sound smug, but I'm the author of the Jackbox Games multiplayer servers, I regularly handle hundreds of thousands of simultaneous websocket connections from players' phones. I can't for the life of me find a server implementation of webrtc data channels that I would actually put into production. I've seen a few blog posts with toy examples, but nothing that is ready for production. It sounds nice in theory, but try actually finding a production-ready server implementation of WebRTC data channels. I would LOVE to find a documented example of doing client-server communication with WebRTC data channels (a Go implementation on the server specifically). I've found no such thing. Every few months I search and don't find such a thing, and I don't need the extra few ms of latency improvement badly enough that it would be worth the engineering time to author it myself. If you know of one that's actually ready for primetime, I'd love to hear about it. edit: after writing this comment, I did some snooping around since I haven't snooped around on this topic in a few months, this looks promising, unclear how widely used people are using it for production work: https://github.com/pion/webrtc https://github.com/pion/webrtc
- J_tt 7y agoOne thing I've always been curious about with JackBox is if it does anything when everyone's on the same LAN?
- zemo 7y agonot sure what you have in mind, but no not currently
- blackflame7000 7y agoWhat about household vs household games? Bring a new meaning to keeping up with the Jones’s :)
- vvanders 7y agoHad to write the SDP handshake and re-build a subset of SCTP from scratch since the only SCTP implementation uses a global listener which doesn't play nice for a clean server implementation(it was also a royal pain to compile in a way that played nice with Rust). I got it working far enough to handle the WebRTC handshake over SCTP and get some basic data flowing. It's still in pretty rough shape and ran out of time to document it to any degree where someone else could take it and run with it. If there's enough interest I might pick it up again but right now I've got other priorities going on.