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>
This commit is contained in:
SchluffeandClaude Opus 5.5 committed 2026-10-25 18:51:42 +01:00
1 parent 5729ed62f7
commit 840bc3572b
6 files changed
+361 -85

No files matched your search

+8 -5
View File
@@ -69,9 +69,11 @@ networks, a direct connection may not be possible.
## Privacy
- The file only goes to the person you connected with.
- That person learns your IP address, as with any direct connection. The tracker and the STUN
servers see it too, from the request itself. Nobody without the code learns it through the
tracker.
- That person learns your IP address, as with any direct connection. One STUN server and one or a
few trackers see it too, from the request itself. HellCon tries the STUN servers in order and
sticks with the first that answers. The sender stays on the first tracker that accepts it. The
receiver goes down the list until it finds the sender, and the trackers it passes keep its
encrypted offer. Nobody without the code learns your address through a tracker.
- Settings (STUN on or off, your server lists) are kept in your browser only.
- Whoever hosts HellCon serves the code that runs in your browser. If you'd rather not trust that,
host your own (below).
@@ -80,8 +82,9 @@ networks, a direct connection may not be possible.
Under **Servers** you can change which STUN servers and trackers your browser uses, one address per
line. Any WebTorrent compatible tracker works, including one you run yourself. **Reset to defaults**
brings back the original lists. Both sides must use at least one tracker in common to find each
other.
brings back the original lists. The order matters: the sender stays on the first tracker that
works, the receiver tries them in order until it finds the sender. Both lists must contain that
tracker.
## Host your own