Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wish there was a way to do local peer discovery with WebRTC. Right now both endpoints need an active Internet connection and a shared identifier (in this case a special URL) in order to find each other. Can't do offline local sharing.


You can! https://github.com/pion/offline-browser-communication

It uses mDNS for discovery. You can only do one browser though.

I don’t see a path forward on browser/browser that is obvious. It would make it so easy to fingerprint if you could set your mDNS hostname in JS


If one end of the connection is a native app like this you have plenty of other options. Browser to browser is the use case I'm talking about.

It could be done with a browser-owned dialog to select peers instead of exposing all local peers to the web by default. Similar to the web MIDI API or others that expose local devices only with explicit user permission for the specific device.


A QR code should work if at least one of the browsers has camera access, I suppose?



iroh's stuff is great but their local peer discovery can't work in a browser, since it uses an mdns-like protocol to do it


I solved this issue by implementing a webtorrent tracker[1] client. Signalling server is still needed, but with this approach any webtorrent tracker can act as one.

[1]: https://github.com/webtorrent/bittorrent-tracker


Sharing identifier maybe we could do with qrcode, chirp audio protocol, nfc tap. Ios has peerconnectivity that works really as p2p network but sadly no web api and doesn't work android (not sure someone reverse engineered protocol)


Somebody indeed has, but since it uses a custom low-level 802.11 variant, I don't think it's feasible on (at least non-rooted) Android devices: https://github.com/seemoo-lab/opendrop


Couldn't you use sound/bluetooth/qrcodes/etc. to do signalling?

I once did it by copying messages from textarea's back and forth.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: