Commit Graph
6 Commits
Author SHA1 Message Date
Schluffe 02668de602 Add IPv6 to the coturn config 2026-10-25 20:46:19 +01:00
SchluffeandClaude Opus 5.5 840bc3572b Contact one STUN server and one tracker at a time
Both sides used to contact every STUN server and tracker at once, so each of them learned the IP
address and each tracker that A sent to B.

Connections now use one STUN server: the first in the list that reports a public address to a
throwaway probe connection within 2 s. It stays for the page's lifetime. If a connection gets no
address from it, the next connection probes on from the server after it. A probe runs only while a
session waits for it and stops once none does, STUN is turned off or the list changes.

The sender joins the first tracker that accepts it and moves to the next only once that one rejects
it, can't be reached within 10 s or is lost. The receiver walks the list with one offer each and
stays where a tracker reports a seeder (complete), which is the sender: it always announces before
anyone has the code. Trackers it passed keep its offer. backend/tracker.mjs now sends complete.

wss://tracker.pagequit.net comes first in the default trackers, the public ones are fallbacks.
TODO.md drops the server tasks, they aren't work on this codebase.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 18:51:42 +01:00
SchluffeandClaude Opus 5.5 5729ed62f7 Add backend/.env.example
It shows what ORIGINS has to look like: exactly what browsers send as Origin, so scheme, host and a
non-default port, without path or trailing slash. Anything else locks out every client. CADDY_NETWORK
is there too, commented out with its default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 18:51:42 +01:00
SchluffeandClaude Opus 5.5 8b36e51b56 Require Node.js 26.12.1, it fixes CVE-2026-111497
26.11.1 has the out-of-bounds write in its Brotli decoder. The tracker decompresses nothing, but
the image and development machines should still not run an affected version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 16:09:49 +01:00
SchluffeandClaude Opus 5.5 4725b14a40 Limit pings like messages in the tracker
ws answered every ping on its own, past the message rate limit and past the bound on bytes queued
for a peer: a client pinging without reading made the tracker buffer pongs until it ran out of
memory. Pongs are now sent by the tracker, pings and pongs count as messages, and a pong is queued
only within the same bound as any message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 15:54:03 +01:00
SchluffeandClaude Opus 5.5 22d794965e Add an own tracker and STUN server in backend/
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>
2026-10-25 15:26:42 +01:00