Peer-to-peer file transfers in the browser

github.com

605 points by keepamovin 11 days ago


smusamashah - 11 days ago

I keep a long list of browser based and CLI p2p file transfer tools[1].

LimeWire (which now has its crypto currency probably) has been on a rampage recently aquiring some of really good tools including ShareDrop and SnapDrop. https://pairdrop.net/ is the last one standing so far.

[1]: https://gist.github.com/SMUsamaShah/fd6e275e44009b72f64d0570...

Springtime - 11 days ago

Opera browser used to have P2P file transfers as a short lived feature in ~2010, called Unite. I remember it also had skeuomorphic GUI of a 'fridge' where users could put post-it style notes that could be seen by others.

One of many everything-and-the-kitchen-sink features Opera Presto had during its heyday. Others included a separate Bittorrent client, desktop widgets that could be moved outside of the browser window, full IRC client, email client and peerless hotkey actions customization.

By some miracle the browser still managed to be a rather lean binary.

latexr - 11 days ago

The thing that usually annoys me about these services is they tend to give you an intractably complex URL to share with the recipient. This poses a problem because every time I need such a P2P transfer, I’m communicating with someone over the phone and they need the file on a computer (which may not even be their own, so email is also cumbersome).

https://file.pizza does this better than most, as the URL consists of real words. But all the words are ingredients in English which comes back to being an issue again.

https://pairdrop.net is my go-to, since it allows creating temporary “rooms” with just five letters, which are easy to share over the phone.

Still, I continue to wait for the holy grail of a P2P service which would allow me to initiate a connection via CLI and get a simple URL to share with someone who could download the file from a web browser, saving me from having to babysit the browser tab. There are services which allow you to upload via CLI and download via web browser, but they host your file so you have to wait for the full upload to finish before sharing the link.

modeless - 11 days ago

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.

mary-ext - 11 days ago

rather worried that it's going to go the same fate as ShareDrop (https://github.com/ShareDropio/sharedrop) and Snapdrop (https://github.com/SnapDrop/snapdrop) where they recently got taken over by LimeWire the crypto/AI company.

crazygringo - 11 days ago

> Because data is never stored in an intermediary server, the transfer is fast, private, and secure.

But WebRTC needs a TURN server for when hole punching/STUN doesn't work when both clients are behind NAT.

Data is never stored in an intermediate server, but it can pass through.

How is the privacy and security ensured that the TURN server won't/can't read your data? Do you just have to trust them? Or is a form of E2EE employed?

I'm surprised this isn't even metioned on the page. Or does this not include TURN servers, and so file transfers just fail between certain peers? (Which it doesn't mention either.)

amelius - 11 days ago

It's so strange that this should have been a solved problem decades ago, but somehow a robust and secure non-commercial solution never gets off the ground.

Speaking of which, how is the IPFS project doing these days?

arthursw - 11 days ago

I really like PairDrop https://github.com/schlagmichdoch/PairDrop

Rygian - 11 days ago

There is also Magic Wormhole [1] which is not in-browser.

[1] https://github.com/magic-wormhole/magic-wormhole

cassepipe - 11 days ago

If having someone intall transmission (or your favorite torrent client) is not a hurdle, I like the privtracker approach a lot : https://privtracker.com/

The reason I like it more is that most torrent clients can run in the background by default so it's not dependant on keeping a browser tab opened

It made it to the frontpage not so long ago but it'd be a pity if you had missed it

dusted - 10 days ago

I did the same thing a long time ago, though I cant brag about using as long a list of frameworks, source is https://github.com/DusteDdk/fileswithafriend so you can host it youself, announcement post and link to site where it can be used is here https://news.ycombinator.com/item?id=39622511

In my version, the entrypoint is not uploading your file (where would it go??) but establishing the connection between two devices, then bidirectional transfers between them.

0xbadcafebee - 11 days ago

Ignorant question: isn't WebRTC just... built into the browser? Do you really need a stack of 20 things to tell the browser to connect to another browser with WebRTC? Isn't one HTML page with a few lines of javascript enough?

ebfe1 - 11 days ago

Oh i love the use of webrtc for this, thank you for sharing!

This was my half day covid project to share file... inspired by firefoxsend a while back...

https://www.relaysecret.com/

the infra is super lightweight and you can deploy yourself with aws account, it costed me nothing to run and quite useful when needed :)

api - 11 days ago

These are neat but... it's 2025, and there is still no first class standardized ways to move files over the Internet between PC/mobile/edge devices.

quantadev - 11 days ago

Has anyone used this kind of technology to create a kind of one-on-one messaging system that maintains a persistent thread (in browser storage) which can sort of simulate "texting" but without the phone?

martylamb - 11 days ago

Very nice. It reminds me of a similar all-in-browser file transfer tool I built ages ago called nearshare. This was WAY before webrtc was a thing so my approach was to actually run a web server in the browser via a java applet. :)

https://martiansoftware.com/nearshare/

porridgeraisin - 11 days ago

I like https://github.com/schollz/croc

janandonly - 11 days ago

I love this WebRTC based attempt to send files browser to browser.

Too bad I’ve not yet seen it working without hiccups.

I’m currently testing keet, which is in beta but promising as well. https://keet.io/

logicallee - 11 days ago

For a simple no-frills alternative, I have this version on my site:

https://taonexus.com/p2pfilesharing/

ethnographers - 11 days ago

I use https://blip.net which is like a cross-platform AirDrop, but also works over the internet in addition to LAN. Probably the fastest one I found.

bilekas - 11 days ago

Nice project and I always like playing with WebRTC but there is something that has me a little concerned .

> Transfers are now directly from the uploader to the downloader's browser (WebRTC without WebTorrent) with faster handshakes.

Maybe I'm wrong, but there is a signaling server in the middle somewhere along the chain here no ? unless it's just the same as PeerJS in which you first need the clients ID, but connection can be flaky.

From the source I can see it's using PeerJS but react is throwing me off a little bit. It's not clear to me what `useContext(WebRTCContext)` is..

vzaliva - 11 days ago

We tried something similar 17 years ago. We couldn’t achieve true P2P, but we managed to relay a data stream via a server without store-and-forward. The startup was called Pipebytes, and we even got a bit of news coverage: https://www.youtube.com/watch?v=ATqKvra1X3o

It was later sold to another company, which scrapped the P2P part and repurposed it for regular cloud sharing. :(

gruez - 11 days ago

There must be dozens of services like this (ie. peer to peer file sharing over webrtc), but I can never get them to work. Presumably it's because often times one or both of my devices are behind strict NAT, and the service doesn't provide a TURN server (understandable, given that it might be bandwidth intensive). Does anyone know any public/self-hosted service that provides a TURN server?

deknos - 11 days ago

Which browserbased p2p file transfer tool works with STUN and TURN servers? and if possible, also with an cli option?

thenthenthen - 10 days ago

Is it strange that non of these ever worked for me over the years in different places/setups? (between windows/linux/osx). Literally never. Always been thinking of writing my own… I guess thats why there are so many :p

DeathArrow - 10 days ago

Why can't we have a mixed system? A Dropbox like service with built-in file sharing. If there are no other peers or the speed of transferring from peers is slow, you use some servers for seeding.

u7i7i8o8o8 - 11 days ago

Cool concept, has been done a few times before. Would prefer to see a cleaner implementation. Do projects like this really need Tailwind, TS, React? I don't think so.

sellmesoap - 11 days ago

I came across this recently while looking at cosmopolitan lib stuff https://bob.osau.re/

gqgs - 11 days ago

I don't see which use case this is solving that hasn't already been solved by multiple other P2P file sharing browser based software available.

lxgr - 11 days ago

I appreciate every single attempt at solving xkcd #949, but so far, all I'm seeing is an ever-growing pile of evidence for #927.

EGreg - 11 days ago

Isn't this easy to do with just WebRTC? Like, a few lines of code and using some signaling server and relay (STUN + TURN)?

eduction - 11 days ago

It still needs middle out compression imo

seanwessmith - 10 days ago

is there any tool for p2p audio? something to communicate with friends while gaming would be cool

desdenova - 11 days ago

Didn't work here.

The downloader connects, status becomes Ready, then nothing happens.

Tried on both Firefox and Chromium.

Alifatisk - 10 days ago

Idk if this will replace the good ol' snapdrop / pairdrop

alexpadula - 11 days ago

It's a start to something great. Keep it up!

enriquto - 11 days ago

kids these days...

in my time, we used to know each other's IP addresses and just used netcat

gsliepen - 11 days ago

"It's peer-to-peer, trust me bro!" The problem is that you are still using a website provided by a third-party to serve you the JavaScript program that initiates the transfer. It's easy to replace that JavaScript by something that just transfers a copy to the third-party itself. To be sure that the transfer is actually peer-to-peer, either the sender or receiver should run their own fillepizza server (and have verified that the source code does not contain any backdoors or phone-home code). But if you do that, you actually don't need a peer-to-peer solution anymore, it's turned into a client-server problem.

dboreham - 11 days ago

Uses WebRTC, so not actually p2p.

867-5309 - 11 days ago

>FilePizza eliminates the initial upload step required by other web-based file sharing services

homepage is an upload interface..

kenrick95 - 11 days ago

Relevant xkcd: https://xkcd.com/949/

me2too - 11 days ago

That's great

BiteCode_dev - 11 days ago

I miss dukto r5.

casey2 - 11 days ago

>filepizza

Horrible name dude

hackburg - 9 days ago

[dead]

curtisszmania - 11 days ago

[dead]

kjrfghslkdjfl - 11 days ago

[dead]