4 ms·
It could, but with the current WebRTC implementation initial connection establishment between peers requires a signaling server to coordinate network informatio
by nateb2022 2y ago
It could, but with the current WebRTC implementation initial connection establishment between peers requires a signaling server to coordinate network information.
- MuffinFlavored 2y agoHow 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.
- ekr____ 2y agoIt's not just WebRTC. Basically, if you want things to work when both endpoints are behind typical NATs (a very common situation), you need some kind of signaling system. There are several reasons for this: - NAT bindings are usually not stable over long periods of time - Many NATs implement what's basically a stateful inspection firewall, which means that you actually need to send a packet out to the peer's address before it will be allowed to send a packet to you from the outside - In some nontrivial fraction of cases, you actually need to relay traffic through a third party. The result is that you need some coordination protocol to set up the connection and that has to go through some service which is accessible from the endpoints; generally this means some type of service. So, yes WebRTC is designed this way, but it's basically a constraint of any system of this type. For more on this than you wanted to know, see: https://educatedguesswork.org/posts/nat-part-1/ https://educatedguesswork.org/posts/nat-part-1/ and following posts.
- Feathercrown 2y agoI'm kind of surprised that there aren't general-purpose public-use servers for this purpose.
- meiraleal 2y agoYes there are google and many other public stun servers.
- ranger_danger 2y agoSTUN and TURN are probably what you're looking for