Live data from Hacker News

Snapdrop – AirDrop equivalent through a web browser using WebRTC

snapdrop.net

141–150 of 155 posts

Re: Snapdrop – AirDrop equivalent through a web browser using WebRTC

#141
post #61

I am working on an open source framework which connects nodes for collaboration and p2p transfer. I started off with WebRTC at the core but have since made it optional transport due to lack of portability. Snapdrop is amazing but if you give up on WebRTC you can use QR code for discovery and transfer files even when not on the same network.

Do you have any more information on that? Is there already a repo or something I can follow?

WebRTC connection requires the peers to exchange signal data. This can be through a middleman server, Qr code or even pen & paper.

I've made a library that uses WebTorrent trackers to exchange the signal data and make P2P connections : https://github.com/subins2000/p2pt

Re: Snapdrop – AirDrop equivalent through a web browser using WebRTC

#142
post #137

Earlier quoted context omitted.

It's not a SPA that can run without a backend, so no. Most of the clients will need to connect via the backend which is currently run at wss://snapdrop.net/server/webrtc. Without it, they won't be able to penetrate NAT and will be unreachable.

Hmm, I thought WebWTC was p2p? If a server is needed anyway, could it be implemented in easier, OpenWRT-compatible way?

> Hmm, I thought WebWTC was p2p?

You and many others :) WebRTC (Web Real-Time Communications) is faux-P2P, in that in order to establish the P2P connection, you'll need a server in-between as browsers cannot accept incoming connections, you can only dial out and then start listen for replies.

> If a server is needed anyway, could it be implemented in easier, OpenWRT-compatible way?

I'm not sure why it would have to be OpenWRT-compatible? OpenWRT is just Linux run on less-powerful hardware (over-simplification obviously), so anything Linux can run, should be able to run on OpenWRT. Find your favorite STUN/signalling server and try running on OpenWRT, should work fine.

Re: Snapdrop – AirDrop equivalent through a web browser using WebRTC

#143
post #94
post #72

Earlier quoted context omitted.

Majority of people want to use Airdrop to share file in same network in my experience.

Definitely not true for me. My most common scenario is "can you please send me all the photos of the trip/dinner/... in the original resolution" in a car park/train station/street corner.

iCloud album link?

Re: Snapdrop – AirDrop equivalent through a web browser using WebRTC

#144

Earlier quoted context omitted.

Have you tried Syncthing?

not the OP, I'm on Linux + Android and I hate my phone so much. next phone will be a pinephone and a DSLR or mirrorless camera at this rate. the ONLY thing that's worked for me is syncthing -- I can't copy files over USB reliably at all. I guess I could also pay for google photos but honestly fuck google so much. I have a pixel 3a so all I get is the unlimited low-res images. Why the hell this thing can't just backup…

[deleted]

Re: Snapdrop – AirDrop equivalent through a web browser using WebRTC

#145
post #94

Earlier quoted context omitted.

Definitely not true for me. My most common scenario is "can you please send me all the photos of the trip/dinner/... in the original resolution" in a car park/train station/street corner.

iCloud album link?

Please no. The recipient does not actually “have” the photo when it is sent.

Re: Snapdrop – AirDrop equivalent through a web browser using WebRTC

#146
post #55

It's not really an AirDrop equivalent if it requires you to be on the same network. AirDrop is really useful when you're out and about somewhere and you want to send someone a file. In those cases there's possibly not a WiFi available or in the case of visitors to your home; only you are on the network, not your friend. So I would not see the point of using this instead of AirDrop unless you have to send a file to so…

To be fair, AirDrop requires you to be on the same network as well, as otherwise the devices don't have any way of communicating. If you're already on the same WiFi, it'll use WiFi but if not, it'll connect to each other via Bluetooth (eg, connecting to the same network [a network of two devices]), but the setup of the connection is automatic. Maybe Snapdrop can do something similar with the new Bluetooth Web APIs.

That was the initial version of AirDrop that had the same network requirement; future releases negotiated an adhoc wifi connection over bluetooth then used that.

Re: Snapdrop – AirDrop equivalent through a web browser using WebRTC

#147
post #61

I am working on an open source framework which connects nodes for collaboration and p2p transfer. I started off with WebRTC at the core but have since made it optional transport due to lack of portability. Snapdrop is amazing but if you give up on WebRTC you can use QR code for discovery and transfer files even when not on the same network.

Do you have any more information on that? Is there already a repo or something I can follow?

Yes, the first version is here: https://github.com/uhst/uhst-client-js and there is a demo Ping app: https://examples.run/ping/ . Originally my idea was to use SSE for signalling but in version 2 it becomes a relay between peers. This approach will make it portable to mobile (native, Flutter, RN) which is difficult to do with WebRTC. The added throughput and latency should be similar to using TURN server with WebRTC. Websockets are the more common choice for signalling but HTTP/2.0 brings a new life to SSE.

Re: Snapdrop – AirDrop equivalent through a web browser using WebRTC

#148
post #61

Earlier quoted context omitted.

Do you have any more information on that? Is there already a repo or something I can follow?

WebRTC connection requires the peers to exchange signal data. This can be through a middleman server, Qr code or even pen & paper. I've made a library that uses WebTorrent trackers to exchange the signal data and make P2P connections : https://github.com/subins2000/p2pt

Signalling through QR code or pen & paper while possible in theory is not feasible in practice because both sides need to exchange ICE candidates & offer/answer. So a signalling middleman, whether through websockets, SSE, polling, etc. is needed. And if you want to support network handoff then you need persistent connection to the signalling server for re-negotiation.

Re: Snapdrop – AirDrop equivalent through a web browser using WebRTC

#149

Earlier quoted context omitted.

iCloud album link?

Please no. The recipient does not actually “have” the photo when it is sent.

but they have the option to download (with the iCloud share link, not shared album).

Re: Snapdrop – AirDrop equivalent through a web browser using WebRTC

#150
post #55

It's not really an AirDrop equivalent if it requires you to be on the same network. AirDrop is really useful when you're out and about somewhere and you want to send someone a file. In those cases there's possibly not a WiFi available or in the case of visitors to your home; only you are on the network, not your friend. So I would not see the point of using this instead of AirDrop unless you have to send a file to so…

İ have an Android and a MBP. The number of times where İ think, "why is this so hard to get this file to that computer" is more than I'd like to admit. Cloud drives (iCloud, OneDrive, GDrive) are all too slow on bad WiFi. This should help me.

[deleted]
Post reply on HN