4 ms·
WebRTC is lowkey one of the most underrated technologies out there, ESPECIALLY WebRTC data channels. WebRTC data channels are basically “UDP on the web” but th
by valorzard 2y ago
WebRTC is lowkey one of the most underrated technologies out there, ESPECIALLY WebRTC data channels.
WebRTC data channels are basically “UDP on the web” but they have lots of controls to change how reliable they are, so they can be used as TCP style connections as well.
I still don’t fully understand why more people don’t use them over something like QUIC. (I think I’ve asked this question before here, but I wasn’t really satisfied with the answers)
I sadly switched off of using them, but mostly because the ecosystem around there is super underdeveloped compared to the ecosystem around QUIC/quinn. There is a LOT of boilerplate involved that feels unnecessary.
But, if you’re making a multiplayer game in the web, it’s basically the best technology to use cuz it already works. And if you use a library like libdatachannel or pion, you could make the game in Go or C++ and compile it for both Steam and the web!
Here’s a project I did with them that shows off compiled for both web and desktop: https://github.com/ValorZard/gopher-combat https://github.com/ValorZard/gopher-combat
- ronsor 2y ago> I still don’t fully understand why more people don’t use them over something like QUIC. > the ecosystem around there is super underdeveloped compared to the ecosystem around QUIC/quinn > There is a LOT of boilerplate involved that feels unnecessary I think you just answered your own question and even gave the answers I would've given.
- valorzard 2y agoWell it’s a bit of a chicken or the egg situation right? None of those issues will get better if no one uses it.
- torginus 2y ago> I still don’t fully understand why more people don’t use them over something like QUIC Dealing with NAT traversal especially with full-cone NATs is difficult and expensive - you have to maintain dedicated infrastructure of TURN servers for NAT and you have to proxy all your traffic through that, it's quite the overhead, especially since IPv4 addresses and bandwidth on AWS don't come cheap.
- Sean-Der 2y agoI am so happy that WebRTC has so many implementations. Every developer thinks differently, it's good to have a implementation that matches your mindset. * https://github.com/shinyoshiaki/werift-webrtc https://github.com/shinyoshiaki/werift-webrtc (Typescript) * https://github.com/pion/webrtc https://github.com/pion/webrtc (Golang) * https://github.com/webrtc-rs/webrtc https://github.com/webrtc-rs/webrtc (Rust) * https://github.com/algesten/str0m https://github.com/algesten/str0m (Rust) * hhttps://github.com/sepfy/libpeer https://github.com/sepfy/libpeer (C/Embedded) * https://webrtc.googlesource.com/src/ https://webrtc.googlesource.com/src/ (C++) * https://github.com/sipsorcery-org/sipsorcery https://github.com/sipsorcery-org/sipsorcery (C#) * https://github.com/paullouisageneau/libdatachannel https://github.com/paullouisageneau/libdatachannel (C++) * https://github.com/elixir-webrtc https://github.com/elixir-webrtc (Elixir) * https://github.com/aiortc/aiortc https://github.com/aiortc/aiortc (Python) * GStreamer’s webrtcbin (C) See https://github.com/sipsorcery/webrtc-echoes https://github.com/sipsorcery/webrtc-echoes for examples of some running against each other.
- esafak 2y agoAnyone used a JVM implementation?
- lostmsu 2y agoSadly, SipSorcery is lagging behind as of now. We only have H.264 and VP8 support for video, data channels only have partial implementation (only reliable ordered), and the performance of data channels is far from what it could be. But it is a great starting point for anyone working in C#.
- shay_ker 2y agoUnfortunately, there's massive drift between WebRTC implementations. The status quo is Google's, which is used by Chrome: https://webrtc.googlesource.com/src/ https://webrtc.googlesource.com/src/ And everyone else has to play catch-up. A big source of the drift is having a common library for SDP parsing, but also necessary features like BWE, different encodings, etc. For example, aiortc, python's WebRTC implementation, isn't quite at the level most would want. It isn't necessarily easy to tell, without clear benchmarks, which implementation is at-par with Google's.
- moffkalast 2y agoThe horrible boilerplate and complexity is why people don't use it. Getting even simple usage examples seems to be a tall order for some use cases and LLMs are hopeless in trying to help with it. P2P connections are also often blocked by ISPs for whatever reason, making it impossible to use without a fallback TURN server which defeats the entire purpose of the thing if you wanted to do scalable multiplayer without the server infrastructure. You're left sending over the whole stream with double the latency and have to eat all the bandwidth.
- spencerflem 2y agoIm excited for WebTransport for similar reasons. Being peer to peer is really cool though
- aspbee555 2y agoI have been working on a quic/webrtc application for a while, webrtc capabilities are severely underrated since everything pairs it with TCP signaling defeating the power of webrtc
- numa7numa7 2y agoI have no knowledge of any of these but do you think webRTC might be superior to websockets for a multiplayer game at this point?
- Sean-Der 2y agoDepends! If you want unordered/non-sequential it could help. If you don’t care about those things could be more work for no value.