backend/ runs both as Docker Compose services, neither is needed: the client works with any WebTorrent tracker and STUN server. The tracker is one file on Node and ws that does only the part of the protocol HellCon uses. It accepts allowed origins only and messages of at most 16 KiB, only announce, one offer per announce and answers only to offers it delivered, once. Forwarded messages are rebuilt from the checked fields. It limits the message rate, the signaling each connection sends, the bytes queued for a peer that stops reading, connection age, connections per IP and in total, and peers per swarm. It logs nothing. coturn runs STUN only on the host network, pinned, read-only and without capabilities beyond the one its binary needs. backend/tracker.spec.mjs tests its rules one by one, e2e.spec.ts sends a real file through it alone in both directions between Chromium and Firefox. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2.7 KiB
TODO
Server at pagequit.net
backend/ holds both servers, tested locally: a real transfer Chromium to Firefox through only them,
and the tracker's limits one by one. Left to do on the server:
- Replace the running coturn with
backend/compose.yaml. coturn 4.18 has the admin CLI, DTLS, the RFC 3489 MAPPED-ADDRESS and the software attribute off by default, the--no-options for them are gone. SetORIGINSinbackend/.env, andCADDY_NETWORKif Caddy's network isn'tcaddy. - Add
tracker.pagequit.netto Caddy and DNS (A record, likestun.pagequit.net). - Check that the logs hold no client addresses: transfer once, then
docker compose logs | grep <your IP>should stay empty. - Then put
wss://tracker.pagequit.netfirst inDEFAULT_TRACKERSand keep the public trackers as fallbacks. - coturn doesn't rate limit STUN requests. A response is about as big as the request, so it's a weak
amplifier. If it gets abused, an nftables
limiton the UDP port would help.
Ideas
- Resume interrupted transfers: the receiver already reports how much the download manager has
read (
{ read }), which is where a new connection could continue. The browser can't append to a finished or failed download though, so a resume would have to start a new one.
Open observations
-
Firefox ignores an errored service worker response stream: when the sender vanishes, the receiver logs "download failed: connection lost", but the download stays "in progress" until the user cancels it. Closing the stream instead is worse, Firefox then reports the truncated file as complete despite
Content-Length. Chromium fails the download, but only once the connection counts as failed (~16 s), because its data channel never firesclosefor a vanished peer. -
Firefox also saves a truncated file as complete when it stops the service worker in the middle of a download (after 30 s without events). The receiver's pings (
KEEPALIVE) prevent that, covered bylarge: firefox survives a 40 s stall. A browser that stops it anyway would still never show "download complete" or "delivered", only its download manager would be wrong. -
large: firefox sends 2.5 GiBhit the 5 minute timeout once (first run after the normal suite), not reproduced in 3 runs since. The report was lost; the attached logs will show the cause if it happens again. -
boundary: chromium sends an empty filetimed out in the first two full runs afterbackend/'s tests were added (2026-10-25), with empty logs on both sides. It passed alone 8 times, and in 5 full runs since, one of them with a cold Vite cache. The suite without the new tests passed 4 times. Not reproduced, cause unknown.