143 points · by todsac · 6y ago · 48 comments
This guy has a bunch of webRTC related ones: https://crates.io/crates/webrtc
- WebSockets
- XHR and other Comet options
- SIP over WebSockets
- XMPP/Jingle
- WebRTC's Data Channel
Obviously, one would want the data channel (last option). There's some work done in this area. However, it's still not full featured.
WebRTC enables peer to peer communication.
BUT...
WebRTC still needs servers:
For clients to exchange metadata to coordinate communication: this is called signaling. To cope with network address translators (NATs) and firewalls.
-------------
[1] https://www.html5rocks.com/en/tutorials/webrtc/infrastructur...
So you always need some form of signaling but that can be over email or even a handwritten note if you prefer, although it is usually done over HTTP/websockets.
STUN is required if you are behind some sort of NAT.
TURN is required if your NAT does not play well with hole-punching.
[1] https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/...
How would that even work? You need signaling to set up the data channel, so how could you handle signaling over a channel that isn't set up?
In practice, I know nobody who does that though. I don't think the extra complexity is worth it if your mesh are never really big, and with WebRTC, you rarely encounter situations where you have more than a few peers in the same mesh (Google Chrome even used to struggle a lot if you had more than a few dataChannel opened on the same page, while Firefox handled hundreds of connexions without issue).
I guess the mesh needs to be pretty small so that you can have a fully connected mesh or you'd need some way to deal with netsplits and a gossip-style protocol for discovery of new nodes, right?
Whoops turtles..
Is Java a fad? Its early years were much more hype driven than Go has been at any time during the 10 years Go has been around.
Python? JavaScript? Ruby? Rust?
What I like about the Go community is that it appears to be very measured. Unlike many other communities where the way a language is used becomes bigger than the language. Like Spring and Java. Rails and Ruby.
Or Rust and “look I reimplement X despite nobody giving two shits”. :-)
(My big disappointment with Rust is that it hasn’t found its niche. I’d like that niche to be embedded operating systems. We could certainly use Rust there, because C, C++ and the utterly shit Python-junk used to stich things together is just painful . Competing for attention in server development or any other area that has very strong contenders is clearly an uphill battle)
Dumb question: what would a WASM implementation be useful for? Browsers don't expose "raw" TCP or UDP connections, so even if you have a fully working WebRTC implementation in WASM, there would be no way to connect to anything when ran inside a browser.
Or is this for WASM use outside the browser?
Oh, so in the browser, it would just fall back to the native WebRTC implementation? That would make sense.
It seems to be a pretty fast moving area, a lot of what I find out there is outdated.
https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API
For landscape, I also like the webrtchacks.com blog, and a very smart consultant runs a blog at bloggeek.me.