Hacker News new | past | comments | ask | show | jobs | submit login
Sharedrop: Easy P2P file transfer powered by WebRTC – inspired by Apple AirDrop (github.com/szimek)
117 points by nateb2022 3 months ago | hide | past | favorite | 70 comments



So it's not offline first, and even though it can do P2P through WebRTC I've ran into situation where I wanted to send a file from my android (not supporting AirDrop) phone to someone's iphone (not supporting Nearby Share) when we were both at the same location but days away from cell service.

Localsend can do that. Problem being when the other person did does not have that installed on their phone. It's really crazy how offline-first networking is still partitioned by iPhone/Android for so many years.


Yeah, it's crazy how with a $15 walkie talkie running on AAA batteries you can talk to your friend miles away in the wilderness, but your $1000 phone is a brick if it can't see a cell tower. Something went wrong there.

Pretty soon we're going to have satellite cell service via Starlink. So it will work, but it will be silly when your signals are going to space and back twice to travel a mile as the crow flies.


Your comment led me to searching "Walkie Talkie Mesh" and it turns out it is a thing. Apparently 20 mile radius, 100+ devices, but at an eye-watering price. Getting one for you and your 4 closest friends will run you the price of a Mitsubishi Mirage.

https://beartooth.com/products/beartooth-mk-ii


Retevis also now has RB24, a lora based mesh radio that does voice, but the details are very sparce. The system claims to do up to 32 hops, which has potential for some very decent range with a large enough population.

https://www.retevis.com/rb91-direct-frequency-digital-repeat...

It will be interesting to see how it actually works in real life and how the codec they use sounds like.


Exactly and more generally it'd be interesting to see if those space cell tower live to the promise. I suspect they'd be great for texting and very light web pages but with 7 Mbit/s per cell (that's the number I remember reading) it might end up feeling feel very sluggish if used with our existing internet applications and protocol stack.


>but your $1000 phone is a brick if it can't see a cell tower. Something went wrong there.

I suppose in that case there are mesh networking apps such as Briar? https://briarproject.org/


Doesn't briar expose your hardware MAC


>but your $1000 phone is a brick if it can't see a cell tower. Something went wrong there.

it's not exactly a "brick". airdrop/bluetooth still work albeit at a reduced range.


I've recently had to move a few dozen MBs over Bluetooth and it took several minutes, so this barely counts. AirDrop is artificially limited to Apple devices, as is Google's thing to Google Android. Basically a brick.


Its a mobile (celltower) first technology. Not a device first technology.


> Yeah, it's crazy how with a $15 walkie talkie running on AAA batteries you can talk to your friend miles away in the wilderness, but your $1000 phone is a brick if it can't see a cell tower. Something went wrong there.

right? And it's almost unbelievable that a $150 bike can travel hundreds of miles in the wilderness, but a $30000 car becomes a brick the moment it runs out of gas.


Please use kdeconnect and nothing else. It works ootb and offline and cross platform.

It stays in the background and is fully transparent to your workflow.


But how do I use it to send a file to my friend with an iphone when we're camping?


Local hotspot.


I keep a list of about 10 such browser based p2p file sending tools https://gist.github.com/SMUsamaShah/fd6e275e44009b72f64d0570...

Have made this using occasional threads like this one and update it when I find some new tool.



Checked a few of these which were new. Thanks, will add there.


Consider making this a repo, ala “awesome-local-transfer-tools” or similar.

https://github.com/sindresorhus/awesome


A plain text format-less (bullet points only) list like this lot easier to maintain.


I tried most of these apps some time ago, and the best ones for large files were Landrop and Localsend. If you have a VPN, you can use them to transfer files remotely too.

https://landrop.app

https://localsend.org


landrop appears to be proprietary


No, both are open source

https://github.com/LANDrop/LANDrop


Ah my apologies, there's just absolutely no mention of github or open source on their website from what I could tell, only some corporate policy stuff, so I assumed it was proprietary.


Well, maybe an alternative: Localsend[1]

Works pretty good for my use cases.

1: https://localsend.org/

EDIT: Oh, this was already mentioned... sorry.


If this is truly "inspired by Airdrop", then it should continue to function without a accessible cellular signal or WiFi network, by automatically configuring one of the devices to act as a mobile Wifi hotspot.


Does this work on mobile? I use localsend so far, https://localsend.org/


It works for me on Safari for iOS


Local discovery didn't work for me. Loaded it on my (Linux) laptop and (Android) phone (both Firefox), but they didn't see each other.

I wonder if it's an IPv6 issue? My two devices might have shown up to the server as two different IPv6 addresses, not the same NATed IPv4 address.


How is this different from webwormhole.io?



https://pairdrop.net is a fork that let’s you change your name.


They mention running this cost them money (likely for hosting and Firebase). Isn't there a way that this could be entirely distributed?


It could, but with the current WebRTC implementation initial connection establishment between peers requires a signaling server to coordinate network information.


It'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/ and following posts.


I'm kind of surprised that there aren't general-purpose public-use servers for this purpose.


Yes there are google and many other public stun servers.


STUN and TURN are probably what you're looking for


How can WebRTC be implemented for an app like this to not need a signal server?


For 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.


For 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).


Depends 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.


A "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.

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.


This is like PushBullet but better. Nice work! Gonna try when I need to move something from phone to tabled to PC.


Sadly things are a bit broken if IPv6 is involved:

https://github.com/szimek/sharedrop/issues/55


ELI5: Do you have two devices on the same local network - is it a single common wifi access point in the badlands, just a local lan, no internet? Do I *need* to have your file on my phone? Why?


I'd like to give a shoutout to localsend as well: https://github.com/localsend/localsend


imho https://pairdrop.net/ is the best one of these


PairDrop is quite nice, it's my go to as it always works. It's a fork of the simpler SnapDrop.


I made NearDrop, a macOS implementation of Google's Nearby Share: https://github.com/grishka/NearDrop


> as well: https://github.com/localsend/localsend > imho https://pairdrop.net/ is the best > How is this different from webwormhole.io? > My fave is https://snapdrop.net

it's so funny how everyone have a favorite. They all use standardized hacks on top of hacks, just because ISP do not want to let you serve content and will fight for NAT, which is their only line of defense from everyone else messing with their precious IGMP multicast hacks so they can subsidize their TV business on your internet bill. it's all so funny.

but the best joke is how microsoft and apple both tried to "make things work" in the late 90s (?) with their special zero-conf-by-other-names trainwreak of network protocols.

There's no end in sight.


I have Apple products at home for almost two decades, computer and phone and tablet generations, and I was satisfied in the beginning with the 'just works' kind of attitude that actually worked then, but then came this AirDrop and it almost never worked, still almost never works. Unpredictable which devices in which direction can send files to each other, yes, I have phone<>computer config that works in one direction but not in the other. I do not want to figure out why is this so, I just want to use it. I tell this to prevent the predictably arriving helpful suggestions and explanations, I don't care. Does not work and that's it, I do not rely on that. Doing it some old reliable way instead.


> suggestions and explanations, I don't care

Ok. But for anyone else struggling with it, check the settings for AirDrop, which one of the following are your devices configured to use:

- Receiving off

- Contacts Only

- Everyone for 10 Minutes

I usually am not able to receive even from people supposedly in my contacts, even though mine is set to Contacts Only. But I don't mind that. I AirDrop about two or three times per month with others.

I take my device and their device and I flip receiver to "Everyone for 10 Minutes". Then I AirDrop the photos or files I want to and have no problem. Try this.


Always 'Everyone', everywhere, while trying. Then off. (Also trying other choices out of desperation briefly. I was anticipating OS version, hardware and other exotic remote troubleshooting and explanation attempts actualy, not a flick of the choice available right in front of you...)


> NAT, which is their only line of defense from everyone else messing with their precious IGMP multicast hacks so they can subsidize their TV business on your internet bill.

What are you trying to say? This is intriguing.


all tv channels are transmitted with the same technology state actors use to redirect traffic from some site to their servers. (multicast)

That tech have no authentication or authorization. (IGMP, PIM-SM, whatever)

it mostly consist of a switch or router on the edge NOT forwarding UDP to some class D ip, or something, past it. But all the ancillary protocols have hundreds of redirection attacks still available.

All that is besides the BGP stuff everyone document by now so it's only used as a last resort.

Go read a book on network security published after 2013. If you want to play with it in your home, no need to build a homelab. Your home modem probably have smaller versions of this using uPNP or PCP or something. Not really recalling the consumer version names. But on those you mostly can point ports routed to any device to any other device, started by any device in or out of the network. fun stuff.

the reason i don't remember any of the details is because all the perl scripts written in 2000 or so still work just fine.


None of what you talked about has anything to do with NAT. The Internet in general does not route multicast and getting public IPs in no way will get you access to any multicast networks.


It's all part of the same pile of incompetence. If you move anything from the pile today it all fall down.


No it’s not. Restricting access to the general multicast space (“Internet2” and friends) is very intentionally done on completely NAT-free networks.


I still don't really understand.

What is the conspiracy? Concretely, what is it that I believe is "going on," what is "actually" "going on", and how does the "actually" "going on" part harm me or screw me... somehow?


you are on the detour thread about multicast. The original discussion was about NAT and how ISP will keep everyone needing NAT forever.


But NAT is needed because people use devices that were not designed to have a WAN interface. I was just interested in your POV, in good faith.



that's the apple-flavored-uPnP. it's on the consumer side.


Who uses multicast for TV these days? I'm also unsure what this has to do with NAT.

The reason they use CG-NAT is because there is a complete shortage of IPv4 addresses.


> Who uses multicast for TV these days

you'd be surprised. Every resolution bump it gets back in fashion. And the infra is always left behind.

And there's only a shortage of ipv4 because ISPs drag their feet on ipv6. It's circular. They even talk about IPv6 nat, lol. For user safety now, i think.

remember when DSL didn't allow you to open listening ports? you had to buy "business DSL" for 10x more?


There is no shortage of IPv4 address space. There is a problem with the government and private entities hoarding address space they don't need.

Amazon alone is sitting on billions of IPv4 addresses. They've snarfed up /10's, /8's, and partial /8's: https://toonk.io/aws-and-their-billions-in-ipv4-addresses/in...

Every single man woman and child in the US could get three unique IPv4 addresses each and Amazon would still have billions left over.

And then recently the DoD transferred 175M IPv4 addresses to a shell corporation in Florida nobody has ever heard of, an then that shell corp announced the largest # of IPv4 addresses in the world: https://arstechnica.com/information-technology/2021/04/penta...

The whole "IPv4 space is exhausted" is a load of shit to get people to feel guilty about having a class C and downsizing while Amazon, Google, and Microsoft snarf up more and more IPv4 space. It's exactly like "turn off your lights when you leave the room to reduce your carbon footprint" while a billionaire flies over you in his private jet in a 20 minute flight to the beach because he didn't want to sit in traffic.

All this could have been avoided if a)address space could not be sold or "leased" but had to be returned to APIC b)rules regarding a minimum percentage of your existing address space being announced/routable with actual devices at the other end...before more space will be allocated to you.


No idea where you are but here in the UK nearly all business links come with a static IP at a minimum and leased lines will often have a /29 or /28.

Now a single IP (let's go all dewey eyed and forget about other protocols), for TCP, can support more than 65000 ports. OK, let's suppose we are fixated on port 443. Slap a proxy on it. Now you are restricted by the characters in the alphabet (thanks to DNS) ... oh hang on ... you are restricted by UTF8 and company.

With Dynamic DNS you don't really need a fixed IP either, provided it has a reasonable lifetime. My Dad's home telephony is on the end of a UK Virgin Media residential connection, which gets you a DHCP assigned but largely unfiltered non RFC1918 address. Their new build at the time offered telephony from BT with no internet or no telephony and internet from Virgin. I ported his phone number from his old house and popped in a RaspPBX and used DDNS to get a stable hostname/unstable IP. A UPS ensures that the Pi stays up reliably.

At work, now that unlimited addresses are unavailable, a bit of consolidation is required. I have a HA Proxy that redirects inbound connections based on hostname, URLs and all sorts of things.

If your imagination is restricted to only one component that makes up an internet addressable service then sure IPv4 is a bit small. I do understand that getting thousands of services addressable on a single IPv4 is going to involve reading a few manuals. However HA Proxy and co are open source and just require some effort and a bit of hardware.

I could go on (at length 8) ...


Amazon isn't sitting on billions of IPv4 addresses; that would be at least 50% of the entire worlds addresses.

The article says they are sitting on billions of dollars worth of IP addresses, which is a completely different thing. FWIW I don't think Amazon having 100million IPv4 addresses is that unreasonable given how many sites are on it.


But linear TV viewing is shrinking all the time. I'm sure some people do use it, but I really don't understand what it has to do with NAT?


Your middle paragraph is word salad.




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

Search: