TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Best modern file transfer/synchronization protocol?

70 点作者 daveidol超过 1 年前
Hi HN,<p>I&#x27;m looking to build something to transfer files between two devices on a network (one client and one server, both of which are under my control).<p>Obviously I could write something bespoke with raw TCP sockets, but rather than reinventing the wheel I&#x27;m curious about what existing options people recommend. I assume there are some better technologies than FTP nowadays?<p>Ideally some kind of built-in fault tolerance would be great, because my plan is to use this on a phone&#x2F;in an environment where the connection could be interrupted.<p>Edit: just to clarify - this is something I want to build into an application I am writing, ideally with support across iOS (client), Windows, and mac (server).<p>One way transfer is all I need, and I mostly plan on photos&#x2F;videos (so multiple files ~3-20MB in size).<p>Thanks!

20 条评论

orbz超过 1 年前
No need to get fancy, scp or rsync are the tried and true options here.
评论 #38737517 未加载
ryukoposting超过 1 年前
I use syncthing for this. It&#x27;s a little fiddly to set up, and transfer speeds aren&#x27;t great. However, it&#x27;s very reliable once configured, and it barely uses any resources after an initial scan of the folder you want to sync.
评论 #38738743 未加载
2color超过 1 年前
<a href="https:&#x2F;&#x2F;iroh.computer&#x2F;sendme" rel="nofollow noreferrer">https:&#x2F;&#x2F;iroh.computer&#x2F;sendme</a><p><a href="https:&#x2F;&#x2F;iroh.computer&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;iroh.computer&#x2F;</a><p>Iroh is what you’re looking for. You can embed into your code, and it handled wire encryption, verification, and NAT hole punching. All over QUIC.
评论 #38739863 未加载
pvtmert超过 1 年前
I highly recommend Unison (<a href="https:&#x2F;&#x2F;github.com&#x2F;bcpierce00&#x2F;unison">https:&#x2F;&#x2F;github.com&#x2F;bcpierce00&#x2F;unison</a>)<p>It allows you to sync between 2 machines (bi-directional) over TCP or SSH.<p>Note that TCP way is not encrypted, you may use wireguard as transport layer encryption for that purpose...<p>You can use an external application to copy if file size is larger than an arbitrary number. (Eg: use rsync for files &gt; 1gb)
评论 #38738538 未加载
whalesalad超过 1 年前
seconding rsync and syncthing.<p>the server could expose an smb or nfs share, the client could mount it, and then sync to that mount.<p>rsync over ssh also works, if you do not want to run smb&#x2F;nfs.<p>this is also a cool tool <a href="https:&#x2F;&#x2F;rclone.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;rclone.org&#x2F;</a>
rmorey超过 1 年前
I cannot recommend rclone enough. Been using it to transfer petabyte-scale datasets flawlessly. Available as librclone as well
评论 #38737427 未加载
评论 #38737154 未加载
评论 #38737191 未加载
arun-mani-j超过 1 年前
On a similar note, can someone tell me what&#x27;s the fastest (wireless) way to transfer files between two laptops on same network (i.e. hotspot)?<p>scp, rsync, wormhole give me only 2-3 mb&#x2F;s.<p>For the context, I&#x27;m trying to transfer about 50-70 GB files.<p>What&#x27;s causing the bottleneck here and what am I missing? Thanks in advance!<p><a href="https:&#x2F;&#x2F;github.com&#x2F;magic-wormhole&#x2F;magic-wormhole">https:&#x2F;&#x2F;github.com&#x2F;magic-wormhole&#x2F;magic-wormhole</a>
评论 #38741894 未加载
评论 #38746054 未加载
oschrenk超过 1 年前
If it’s one way (that wasn’t quite clear from the requirements to me).<p>take a look at <a href="https:&#x2F;&#x2F;tus.io&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;tus.io&#x2F;</a>
评论 #38737376 未加载
bhaney超过 1 年前
Yeah I usually just use rsync for this. In a loop if the network is unreliable.
rrix2超过 1 年前
I built something on top of the Syncthing API this week after using it on its own for years.<p>A local instance of Syncthing can behave as a robust sync tool + inotify API for applications consuming the files: <a href="https:&#x2F;&#x2F;docs.syncthing.net&#x2F;rest&#x2F;events-get.html#get-rest-events-disk" rel="nofollow noreferrer">https:&#x2F;&#x2F;docs.syncthing.net&#x2F;rest&#x2F;events-get.html#get-rest-eve...</a><p>i believe there&#x27;s an embeddable golang library, but if you want something easy to use on android check in on syncthing-fork which lets you define more granular sync conditions including &quot;just turn on 5 minutes every hour&quot; <a href="https:&#x2F;&#x2F;github.com&#x2F;Catfriend1&#x2F;syncthing-android">https:&#x2F;&#x2F;github.com&#x2F;Catfriend1&#x2F;syncthing-android</a>
mynegation超过 1 年前
What are your latency and bandwidth requirements? How big are the files? If you are already looking past obvious TCP-based choices like HTTP and FTP, you might be interested in FASP&#x2F;Aspera <a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Fast_and_Secure_Protocol" rel="nofollow noreferrer">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Fast_and_Secure_Protocol</a><p>Edit: I’ll leave it here just in case it is useful for others but it may or may not be embeddable into your app, especially on the phone.
jayknight超过 1 年前
I would probably start with rsync.
评论 #38736755 未加载
sneak超过 1 年前
rsync over ssh for one-shots.<p>syncthing for continuous use.
评论 #38736714 未加载
smackeyacky超过 1 年前
Grab an S3 bucket on amazon.<p>Do a 3 way sync with the s3 command line tool.<p>That way, you have a neat cloud backup as well. Wouldn&#x27;t take any more than 20 minutes total to set up.
评论 #38739700 未加载
eternityforest超过 1 年前
What about Jami? It runs almost everywhere and having an embeddable Jami library would be absolutely amazing, although a fair amount of work.
tripleo1超过 1 年前
1. warpinator, syncthing 2. rclone??<p>--<p>3. self hosted ipfs in tailscale or something? (that would be cool)
pluto_modadic超过 1 年前
continuous sync - mutagen.io (maybe you could extract some of the libraries)<p>depends on if it&#x27;s large or small files.
Helmut10001超过 1 年前
rsync. If you are looking for a long term solution: zfs on both sides with zfs send.
yetanother12345超过 1 年前
eh... wget or curl ? or not modern enough for you?
toomim超过 1 年前
Use HTTP. For fault tolerance, use resumeable downloads or resumeable uploads. There is work at the IETF on resumeable uploads right now: <a href="https:&#x2F;&#x2F;datatracker.ietf.org&#x2F;doc&#x2F;draft-ietf-httpbis-resumable-upload&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;datatracker.ietf.org&#x2F;doc&#x2F;draft-ietf-httpbis-resumabl...</a>
评论 #38737004 未加载