8 ms·
ShareDrop – P2P File Transfer Using WebRTC
- mdrzn 7y agoI've been using this for months now, it's great to quickly transfer files via WiFi on the same network. Right now, I guess it received the HN hug of death.
- Legogris 7y agoYou really shouldn't need any server-side at all for something like this these days (thinking about firebase). Webtorrent should be mature enough. We did something similar back 5 years ago for our BSc thesis project, using a DHT and Namecoin for distributed key exchange. Abandoned and obsolete, but in case anyone's interested: https://github.com/rymdjs https://github.com/rymdjs
- cyborgx7 7y agoYou still need a way to establish a connection between the two browsers.
- melvinroest 7y agoNo you don't, sort of don't. When you look at the Bugout [1] library, you see that they're using the infrastructure of WebTorrent to fix that. I emailed the author and he said he's working on a form of infrastructure in which the infrastructure takes care of this problem. So yea, you don't need a signaling server then. I'm pretty sure the extended version of this idea also includes STUN servers. And I think you'd always need to pay for TURN servers as the NAT is then simply disabling P2P all-together [2]. [1] https://github.com/chr15m/bugout https://github.com/chr15m/bugout [2] Context for people who are like what are all these terms? In WebRTC when you have 2 computers behind different corporate networks trying to connect they need to go through a router. A router performs Network Address Translation (NAT), the internal IP (usually 192.168.178.xxx, definitely not always) needs to become the public IP. The problem is that when both networks are too complicated in its structure, then WebRTC cannot work in undoing this layer of translation. In order to circumvent this, they tunnel your data through a server that has a public facing IP. They call this a Traversal Using Relays around NAT (TURN) server. IMO, you could just see it as an intermediary that shoves data from A to B and vice versa. However, IMO this defeats the point of P2P as you need a 3rd-party helping you to get the data to the other side. Note: other relevant ideas are signaling servers (i.e. knowing each other's reachable address through an intermediary server) and STUN servers (a server that tells you your own public facing IP address).
- cyborgx7 7y agoI would argue that this is still "a way to establish a connection between the two browsers" and therefore does not contradict my comment, but this does seem very interesting and I will look into it further.
- melvinroest 7y agoOh, I misread, haha. Thanks for pointing it out. I fully agree with you. Man, my thinking got lazy these days. I read an argument a while back on HN saying that WebRTC is not purely P2P, I was basically insta-responding to that. I need to read more carefully.
- Legogris 7y agoYes, and it's tricky to make a smooth UX out of it in a web browser setting but the technology is absolutely there. IIRC we managed to make it server-less (in the true sense) apart from the need of a Namecoin gateway. Typically you would use a signalling server coupled with STUN/TURN to discover peers and establish WebRTC connections/routes but it's not required. You could take a look at Rymd above, IIRC the principles are described in the paper. Here's also a minimal PoC that I found by a quick duck: https://github.com/svarunan/serverless-webrtc https://github.com/svarunan/serverless-webrtc Once you have a connection to someone in the network you're in the domain for traditional P2P solutions and protocols. EDIT: Just realized melvinrost explained this better below (:
- dbrgn 7y agoShameless plug: As an alternative to solutions like WebTorrent, if you do need to rely on a signaling server but don't want to send your signaling data (ICE candidates containing IP addresses in this case) unencrypted over a cloud service like Firebase, it's possible to use an end-to-end encrypted protocol for this use case: https://saltyrtc.org/ https://saltyrtc.org/ The good thing about this protocol is that you don't need to trust the server. (Of course it would be nice if we could just send an UDP broadcast or announce the device via mDNS/Avahi, but browsers do not allow direct network socket access, due to reasons™.)
- amanzi 7y agoThis is pretty neat, and in my quick testing between Chrome and Firefox on both Android and Windows, it worked well. A quick search on HN shows that this was first posted 6 years ago as a "Show HN" - looks like it's come a long way since then: https://news.ycombinator.com/item?id=7468328 https://news.ycombinator.com/item?id=7468328
- seq 7y agoFor me, on Chrome, it just stays on "Loading": DOMException: Failed to set the 'binaryType' property on 'RTCDataChannel': Blob support not implemented yet at https://www.sharedrop.io/assets/vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3805:171 https://www.sharedrop.io/assets/vendor-6deb0f828efb7a002b3c4... at https://www.sharedrop.io/assets/vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3806:279 https://www.sharedrop.io/assets/vendor-6deb0f828efb7a002b3c4... at https://www.sharedrop.io/assets/vendor-6deb0f828efb7a002b3c4761e62c6e4d.js:3892:117 https://www.sharedrop.io/assets/vendor-6deb0f828efb7a002b3c4...
- currysausage 7y agoThere's a clone at https://snapdrop.net/ https://snapdrop.net/ which loads a little faster and works a little more reliably in my experience. FAQ: https://github.com/RobinLinus/snapdrop#frequently-asked-questions https://github.com/RobinLinus/snapdrop#frequently-asked-ques...
- dbrgn 7y agoThis looks nice. However, when it does the automatic fallback to WebSockets, will the file be sent unencrypted? The FAQ does not mention encryption, it only says that data is not stored on the server...
- deleted 7y ago[deleted]
- huhtenberg 7y agoDamn... that's very slick.
- grenoire 7y agoAnd the server side is only 229 lines (https://github.com/RobinLinus/snapdrop/blob/master/server/index.js https://github.com/RobinLinus/snapdrop/blob/master/server/in... ); quite the feat.
- Angostura 7y agoTrying at work (behind aggressive firewall). Loaded on my Mac OK with Safari first time. On my iPhone (same wifi) I just get 'Loading'. Have we killed it?
- smcleod 7y agoI thought that too - it just takes ages to load on iOS for some reason
- coconutrandom 7y agoJust shows "Loading" and the warning "firebase.js:39 FIREBASE WARNING: The Firebase database 'sharedrop' has reached its peak connections limit." But if this is interesting, checkout https://instant.io https://instant.io which uses the webtorrent protocol.
- bobosha 7y agoThis is a neat idea, I have had the same idea and been meaning to work on this for a while. Thanks for building this. Can you share the technical details behind this? Also, what is your business model? Freemium?
- jackewiehose 7y agoAfter working with WebRTC and realizing its potential I immediately disabled it in my webbrowser. One fear was to become a peer in a (copyright infringing) p2p-network, unknowingly just by visiting a random website. WebRTC can be very useful but I think browsers should ask for special permissions like they do for camera access etc.
- dmos62 7y agoThat's a good idea. Already many privacy protecting extensions disable it, because it can leak private information [0]. [0] https://github.com/gorhill/uBlock/wiki/Prevent-WebRTC-from-leaking-local-IP-address https://github.com/gorhill/uBlock/wiki/Prevent-WebRTC-from-l...
- jackewiehose 7y agoIf you downvote this it would be nice to know where I am wrong.
- cerberusss 7y agoIt's ridiculous that this isn't turned off by default. Here's a Firefox extension which does exactly that: https://addons.mozilla.org/en-US/firefox/addon/happy-bonobo-disable-webrtc/ https://addons.mozilla.org/en-US/firefox/addon/happy-bonobo-...
- miles 7y agoWhy risk installing an add-on when you can achieve the same end just by using about:config to set media.peerconnection.enabled to false?
- nerdponx 7y agoWhy hide basic configuration in an under-documented use-at-your-own-risk settings editor?
- cerberusss 7y agoMy thought was, that the extension is very easy to switch on/off. However since installing, I have never wanted WebRTC to be on...
- deleted 7y ago[deleted]
- cyborgx7 7y agoI've been using file.pizza for the exact same thing. Can't evaluate sharedrop right now because it is dead, but I find that the aesthetic of file.pizza makes it very approachable for a lot of people, though some people might consider it untrustworthy because of it.
- timvisee 7y agoShameless plug to Firefox Send (https://send.firefox.com/ https://send.firefox.com/) with ffsend (https://github.com/timvisee/ffsend https://github.com/timvisee/ffsend). Crypto is done on the client. The key is in the share URL and is not sent to the server.
- deleted 7y ago[deleted]
- dbrgn 7y agoThere's this situation that comes up again and again: It's 2019 and I want to send a (potentially large) file from my phone to my computer, or from my computer to my wife's computer. How do I do it? - USB connection? I don't want to dig out my cable and climb under the desk to plugin the USB cable. - Samba share? Forget it. - FTP server app? Works, but usually quite slow and painful. - Start a HTTP server to serve the directory? That works, but seriously? - Sending via E-Mail or Dropbox? Oh FFS, both devices are connected to the same WiFi access point, how can it be that uploading the file to a cloud hosted across the world and downloading it again from my other device is the simplest approach? So far, Sharedrop is the simplest solution I know that works across any device that has a modern browser and that allows me to send the file directly from one computer to the other, without the need for logins or accounts or external software or arcane command-line incantations. (The WebRTC Datachannel stack is horrible and mostly neglected by browser vendors, especially Google, but that's another story...)
- juskrey 7y agoI have found btsync (now Resilio Sync) the best available p2p solution, albeit requiring sync app installation, still you need some app anyway, being it the browser, file manager etc.. It uses local network when available and of course internet when not. It also does iOS.. if only more apps were supporting FileProvider functionalities, so you don't have to import-duplicate all the synced data first.
- dbrgn 7y agoIt requires installing proprietary software on all devices though, while your browser already brings along an open source and mostly standardized P2P stack.
- juskrey 7y agoThere are open source alternatives like syncthing, which is still not as user friendly. Also single file sharing seems interesting, but this is not what you usually do on daily basis... You just want to drop some file to shared folder most of the time, or to have a ton of different files synced automatically.
- VvR-Ox 7y agoIt's wonderful just like SnapDrop and I recently found another one: https://github.com/spieglt/FlyingCarpet https://github.com/spieglt/FlyingCarpet I love the "Air Drop" feature from apple and I'm very happy we can do this on linux now without the need to explain someone how to open a socket in the terminal ;-P
- jjbinx007 7y agoI've seen a lot of suggestions for alternatives but nobody's mentioned station307.com yet
- ignoramous 7y agohttps://instant.io https://instant.io by u/feross [0] is another tool that I use: It does BitTorrent over WebRTC [1]. [0] https://news.ycombinator.com/user?id=feross https://news.ycombinator.com/user?id=feross [1] https://webtorrent.io/faq https://webtorrent.io/faq
- MaxikCZ 7y agoPC and Android on same hotel wifi didnt find each other. Understandable, scanning QR code paired devices nicely. Did speedtest.net on PC: 14/10 Mbit down/up with 8ms ping. on AN: 35/ 7 Mbit down/up with 13ms ping. Transfering AN -> PC at 3 Mbit/s When refreshed site on PC to try another direction my PC is stuck on "loading". After restarting browser it went trough, but now my Android is stucked at loading. After completely closing firefox in Android I was finally able to pair again to do speedcheck in other direction: Transfering PC -> AN at.... 20 MB file transferred, by eye, 20% and got stuck. Well, the search continues...
- bscphil 7y agoYou're encountering basically what I've seen myself when trying to use any of these P2P services. Most of them don't work at all, and those that do seem to work too slowly to transfer a file of any reasonable size, even on the same WiFi. I have no problems with any other transfers, including torrents, which all run at full speed. But WebRTC stuff just never works for whatever reason.
- s09dfhks 7y agoHow does this differ from filepizza?
- ishanjain28 7y agoI don’t like webrtc based solutions because the speeds are subpar. My phone and iPad are on the same WiFi network and both have a link speed of roughly 400mbps. Using trebleshot(a oss file sharing tool like shareit/midrop) I was able to get 30-40MBps which is pretty insane speed if you ask me. But sharedrop didnt’t work. It failed with “could not establish direct WiFi connection with peer” error and with snapdrop that someone else suggested I could only get speeds of up to 15mbps(or roughly 2MBps). I only use trebleshot on android and trebleshot via the web interface to transfer between iOS and android. It’s the fastest tool I have ever used and I strongly recommend it if you are looking for a tool like that. TLDR being, webrtc based tools for p2p file sharing suck.
- szimek 7y agoShareDrop author here. It's really great that people are still using it, after almost 6 years since the release! It was first announced here on HN: https://news.ycombinator.com/item?id=7468328 https://news.ycombinator.com/item?id=7468328. Fun fact: on the same day Facebook announced Oculus acquisition ;) Also, sorry that the service was down for some of you yesterday - it's using a free Firebase account that has a limit of 100 connections - usually it's enough.