9 ms·
You only really need the server for signaling. The STUN/TURN is only for NAT penetration / media relaying in case direct p2p is not possible. You do not strict
by kabes 6y ago
You only really need the server for signaling. The STUN/TURN is only for NAT penetration / media relaying in case direct p2p is not possible.
You do not strictly need a server for signaling in some controlled environment cases (e.g. you can do signaling over sound for closeby peers).
- capableweb 6y agoYeah, and a bunch of other caveats, hence my ask to look into the specific technologies to understand more how it works, and why it works the way it works. And while it's true that you don't strictly need a server for signalling, most people would expect a library called PeerJS to work P2P over the internet, without requirements to have a speaker/microphone and also without having to be within speaker/microphone range.
- e1g 6y agoYes, one huge challenge of P2P over the internet is piercing the NAT veil of ignorance. WebRTC hides this complexity, but I found it highly informative to read about how NAT traversal works even if I'll never touch this mess in my line of work -> https://tailscale.com/blog/how-nat-traversal-works/ https://tailscale.com/blog/how-nat-traversal-works/
- car 6y agoReliable NAT traversal is what propelled Skype to fame and billions back in the day, and was later codified by the VoIP folks at the IETF into STUN/ICE and TURN. WebRTC is basically a VoIP client with JS API built into the browser.
- snicksnak 6y agoThe tailscale blogpost about "how NAT traversal works" [0] is a fantastic resource to dive into those those network related challenges. [0] https://tailscale.com/blog/how-nat-traversal-works/ https://tailscale.com/blog/how-nat-traversal-works/
- Sean-Der 6y agoWebRTC is complicated, it can be frustrating to get into! If you have a chance take a look at https://webrtcforthecurious.com https://webrtcforthecurious.com it is a CC0/Free book I am writing. Would love your opinion and if it helped at all. I also try and write https://github.com/pion/webrtc https://github.com/pion/webrtc in a way that others can learn from it. I put all the specific tech in different repos so people can see the big picture.