4 ms·
How can WebRTC be implemented for an app like this to not need a signal server?
by MuffinFlavored 2y ago
How can WebRTC be implemented for an app like this to not need a signal server?
- the8472 2y agoFor physically local use: You could turn the session initiation tokens into QR codes and show them to each other For P2P over the broader internet: Either use another channel to convey the token or use a native application that can speak UDP/TCP to do actual distributed P2P transfers.
- kelnos 2y agoFor the broader internet case, you'll probably still be dealing with NATs between both devices, so you'll need a centralized STUN (or even TURN) server to hole-punch (or relay).
- the8472 2y agoDepends on your goals, bittorrent does without STUN servers by coordinating over other peers in the network. Time-based coordination and simultanous-open is another strategy.. And there's IPv6. Local peer-to-peer wifi can probably use multicast for discovery. The situation isn't pretty, but there's more than what WebRTC with its single-use sessions offers.
- talkingtab 2y agoA "signal server" in this situation is any method that will allow the two end points to connect. However, you simply need to be able to exchange a few setup packets. People used web sockets for this, but essentially anything that will exchange some information will work. see https://webrtc.org/getting-started/peer-connections https://webrtc.org/getting-started/peer-connections. There is a youtube video on writing a webrtc chat app and (during development) the developer simply copies and pastes between two windows on the same computer. Webrtc file transfer, text chat and video chat all use this information. In addition if one is negotiating connections across NAT servers you use STUN or TURN servers (there are open ones) to establish NAT. Your local computer/phone/whatever will send need to tell the other side what your NAT address is and STUN will do that.