StraightPath 是什么

StraightPath 是一个免安装、免注册、无需服务器的点对点大文件投递工具。发送方把文件切成块,在自己的浏览器里加密,经 WebRTC 直连送到接收方的浏览器:文件字节全程不经过任何服务器,任何一端的内存里也放不下整份文件。传一个文件夹和传一个文件是同一件事。

怎么用 StraightPath 传大文件

  1. 1. 打开 StraightPath,把文件或整个文件夹拖进页面(也可以点选)。
  2. 2. 页面生成一条投递链接和一个二维码。链接尾部的 #k 就是密钥——发给对方就行,不用装应用、不用注册。
  3. 3. 对方打开链接(或扫码)就开始收,全程端到端加密。发送方的页面要一直开着,关掉这一单就结束了。

常见问题

需要装应用或注册账号吗?
不需要。StraightPath 就是一个网页:打开、拖文件、复制链接。接收方也一样,手机浏览器扫码即可开始收。
文件会上传到服务器吗?
不会。字节从发送方的浏览器直接走到接收方的浏览器。唯一经过第三方的是加密后的清单(文件名与大小也是密文)和信令消息,它们走公共 Nostr relay,看不到内容。
能传多大的文件?
没有人为上限。文件按块流式处理,整份文件不会进内存,实测两端 JS 堆峰值停在几十 MB 一档且不随体积上升;限制来自你的磁盘可用空间与浏览器存储配额。
传输中途关掉页面会怎样?
发送方关掉页面,这一单就结束了。接收方关掉页面不会丢已到达的块——它们写在本地(OPFS),重开同一条链接会先问你是续传还是清空重传。
安全吗?
密钥(链接里的 #k)从不发给任何服务器;每个块用 AES-GCM(WebCrypto 不可用时 ChaCha20-Poly1305)加密;收齐后接收方按 BLAKE3 Merkle 根全量重算校验。缺 #k 的链接会被直接拒绝加入。
对方打不开链接怎么办?
最常见的是发送方已经把页面关掉了;其次是两侧都在对称型 NAT 后面,需要在「高级设置」里打开 TURN 中继。

技术上怎么做到的

传输是 WebRTC datachannel(开发与同源回环走 BroadcastChannel,同一套分帧与背压);完整性是 BLAKE3 Merkle 树,哈希引擎按 WebGPU → wasm → 纯 TypeScript 逐级降级,端到端加密用 AES-GCM,落盘用 OPFS 做断点续传与本地副本回收,另有一个可拆卸的 Reed-Solomon FEC 插件在丢块时本地修复。四个环节各自是插槽里的插件,装不上就降级,降不了的那几件(零整文件内存流式、背压、Merkle 校验、端到端加密)任何浏览器都可用。

想先弄清「多大算大文件、为什么必须开着页面、和网盘/邮件附件差在哪」,看《免服务器传大文件:浏览器点对点直传的边界与做法》。英文见 /guides/en/。

What StraightPath is

StraightPath is serverless peer-to-peer delivery for large files — no install, no account. The sender splits a file into blocks, encrypts them in its own browser and streams them over WebRTC straight into the recipient's browser: the bytes never touch a server, and no browser ever holds the whole file in memory. A folder is the same operation as a file.

How to send a large file

  1. 1. Open StraightPath and drop a file — or a whole folder — onto the page (picking it works too).
  2. 2. The page hands you a delivery link and a QR code. The #k at the end of the link is the key; just send the link.
  3. 3. Your recipient opens the link (or scans the code) and the download starts, end-to-end encrypted. Their sender page has to stay open — closing it ends the offer.

Frequently asked questions

Do I need to install an app or create an account?
No. StraightPath is a web page: open it, drop your files, copy the link. The recipient does the same thing — a phone browser and the QR code is enough.
Do my files get uploaded to a server?
No. Bytes travel from the sender's browser to the recipient's browser. The only thing a third party ever sees is the encrypted manifest (file names and sizes are encrypted too) and signalling messages, which go over public Nostr relays.
How large a file can I send?
There is no artificial cap. Files are streamed block by block, so the whole file never sits in memory — measured JS heap peaks stay in the tens of megabytes and do not grow with file size. The real limits are free disk space and the browser storage quota.
What happens if a page is closed mid-transfer?
If the sender closes the tab the offer is dead. If the recipient closes the tab, blocks already received are not lost — they are on local disk (OPFS), and reopening the same link asks whether to resume or start over.
Is it secure?
The key (the #k in the link) is never sent to any server. Every block is sealed with AES-GCM (ChaCha20-Poly1305 when WebCrypto is unavailable), and the recipient recomputes the whole BLAKE3 Merkle root after the last byte. A link without #k is refused outright.
The recipient cannot open my link. Why?
Almost always because the sender closed the page. Otherwise both ends may be behind symmetric NAT, in which case turn on TURN relay under Advanced settings.

How it works technically

Transport is WebRTC datachannels (same-origin development traffic uses BroadcastChannel with the same framing and backpressure). Integrity is a BLAKE3 Merkle tree, with the hash engine degrading WebGPU → wasm → pure TypeScript. Blocks are sealed with AES-GCM, resumable state lives in OPFS, and an optional Reed-Solomon FEC plugin repairs lost blocks locally. Every one of those is a plugin behind a slot: what can degrade does, and what cannot (streaming with no whole-file buffer, backpressure, Merkle verification, end-to-end encryption) works in every browser.

For "how big is big, why must the page stay open, how is this different from a cloud drive or an email attachment", read Sending large files without a server. 中文版:/guides/zh/。