3 ms·
Could I avoid requiring a central server, and still use webrtc, if the two peers I want to connect are in the same lan?
by hobo_mark 8y ago
Could I avoid requiring a central server, and still use webrtc, if the two peers I want to connect are in the same lan?
- api 8y agoI think this is possible, but I'm not sure about the details. I think their IPs need to be obtained somehow though. I don't think you can use things like mDNS from web pages without a plugin.
- singularity2001 8y agowould ip guessing work? 192.168.. … ?
- api 8y agoIt would flood the network with probes and take quite a while.
- mcdevilkiller 8y agoMaybe embedding nmap with the electron app to search for active bodes, then probeing. Requires some C or C++ knowledge though.
- singularity2001 8y agocan't electron js do local pings?
- matthewmacleod 8y agoYou still ultimately need some channel to set up that initial P2P connection. This allows the peers to share the IP addresses at which they’re accessible, as well as the formats and codecs they each support. There’s nothing to stop you doing this through broadcast messages on a local network, though I’m not aware of any way that could be done from within a browser. You could extract the SDP and ICE messages from the browser environment and handle that in Node though, if you were using Electron or something.
- dep_b 8y agoYes: https://github.com/LucasVanDongen/WebRTC-Local-Loop-iOS https://github.com/LucasVanDongen/WebRTC-Local-Loop-iOS Based on: https://webrtc.github.io/samples/src/content/peerconnection/pc1/ https://webrtc.github.io/samples/src/content/peerconnection/... You will need to know where the other peer lives. Which is why they expect you to have a discovery service. But typing in local IP's should work for internal networks. The hardest part is getting through NAT and firewalls and that's not a problem on your own LAN.
- hobo_mark 8y agoThanks everyone, what I essentially want to do is link a phone (my app) with a laptop (running a decent browser) by showing a QR code on the latter, and establish a data channel (not voice or video).