Small downloads, empty or one byte, were sometimes never saved, though the worker reported them
finished and both sides logged success. The browser can read the whole response before it hands
the navigation to its download manager, and the frame was removed right then, which cancels it.
Without a delay an empty file failed 8 of 10 runs, a one byte file 4 of 10.
The download's frame now stays for DOWNLOAD_GRACE (1 s) after finished, the frame that holds the
worker still goes right away. No event tells when the browser took the download, so the 1 s is
empirical. A new test checks the retention on a paused clock, it fails without the delay and with
the worker's frame held too. The browser's timing it can't cover, TODO.md keeps a record of that.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without STUN a side offers only local addresses, enough on the same network or VPN. Between
networks the connection never came up, and nothing said why: tracker signaling only logged "did
not connect" and ended after 6 minutes with the generic message, the manual exchange in Chromium
never ended at all, since Chromium doesn't fail a connection without usable addresses.
A connection that doesn't come up now checks both SDPs for a public address (typ srflx) and names
the side without one, in the log and in the error at the end of the session. That covers STUN
turned off, an empty list and servers that don't answer, on either side. A device with a public
address of its own offers none either, so it's a hint. The manual sender gives up 30 s after the
answer, the receiver after 6 minutes, it has to hand the answer over first.
A note above the cards says when STUN is off or no server is listed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
The SDP relayed by the trackers is now encrypted with AES-GCM under a key derived from the code,
next to the swarm ID and the proof key. Trackers and peers that found the swarm without the code
no longer learn either side's addresses, and an offer or answer that doesn't decrypt is dropped
before any peer connection exists, so it can't take the sender's turn. The proof stays as a
second layer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both sides derive an HMAC key from the code, next to the swarm ID, and sign
their role and both DTLS fingerprints as they see them. An interposer or a
peer that found the swarm without the code can't, so its connection ends and
the next peer gets its turn, as does one that proves nothing within 10 s.
Tracker transfers need no comparing and no clicks anymore, the manual
exchange keeps its fingerprint check. The swarm ID changes once more, old and
new clients don't find each other.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Anyone who sees the swarm IDs could test a GPU's worth of codes against all
of them at once, about 8 % of the codes within a share's 6 minutes. 600,000
iterations of PBKDF2-SHA-256 cost a share ~50 ms and make that negligible.
Old and new clients no longer find each other.
Also note the open decisions for the server at pagequit.net.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Biome formats and lints the TypeScript, the Vue templates and the CSS:
pnpm lint checks, pnpm format fixes. It keeps the existing style, single
quotes and 120 columns, and leaves the vendored logo alone. Besides its
recommended rules it looks for promises nobody awaits. Rules that only
flagged deliberate code are off: non-null assertions that state what the
code guarantees, CSS order where no two rules set the same property, and
fieldset for role="group". The one-time formatting pass mostly splits
long chains.
Promises that are deliberately not awaited are marked with void, none of
them can reject today. Buttons say type="button", the any for peer
messages and the checkbox switch keep their reasons in ignore comments.
The sender's code also counts as no longer valid once a transfer started:
that closes the trackers, so another receiver would wait for nothing,
yet the card still offered the code with Copy. The tracker transfer
tests check it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both default trackers closed the socket of a peer that announced only
once, after about 2 and 3 minutes, and the card then wrongly said no
tracker was reachable. Sender and receiver now announce again on the
interval the tracker names (at least 30 s apart, whatever it names), the
receiver with its same offer.
A share, or a receiver looking for one, gives up after 6 minutes without
a download: its tracker sockets close and the card says nobody came. A
peer connected by then still gets its turn, the transfer itself has no
time limit. The sender's code shows until when it is valid and is marked
no longer valid, without Copy, once it expired or the share failed.
A receiver that lost every tracker now closes its peer connections too,
and the expiry timer goes with the session when it is cancelled, fails
or the download starts.
Tests fast-forward the page clock: re-announcing and expiry on both sides
against mocked trackers, no timer or connection left after cancelled and
failed sessions, and a live download after the deadline passed during
the security check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tracker that answers the announcement with a failure reason counts as
gone, like an unreachable one: its socket closes, and once no tracker is
left the card says which rejected it and why. A failure after the tracker
accepted only concerns that message and is still just logged.
Closing a connection or socket before the session ends now removes its
abort listener, so repeated unusable offers or rejected peers no longer
pile up until the session ends. The sender drops its per-peer listener
when it stops, the receiver only adds one once the download starts.
Both are covered by tests against mocked trackers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every operation (share, receive, manual offer or answer) now runs as one
session tied to an AbortSignal. Starting another ends it: its connections,
tracker sockets and timers close, and it can no longer touch the shared
security check, progress or incoming file. Finished, failed and cancelled
transfers close their connections, and the sender's tracker sockets close
once the download starts.
- A malformed or never-connecting tracker offer no longer blocks a share
- The receiver validates the file offer and rejects excess bytes and
data beyond the flow control window; sw.js checks name and size too
- Failures show up in the card instead of disappearing into rejected
promises: bad manual codes, unreachable trackers, lost connections
- Primary buttons and pink text meet 4.5:1 contrast, the STUN switch
shows keyboard focus again, the tracker Copy button matches the others
- Split the core into src/core.ts, src/main.ts only mounts the app, which
removes the main.ts <-> App.vue import cycle
- Bring back the Gitea source link, write the README
- Tests reuse one browser per worker with fresh contexts, fail on page
errors, check cleanup after transfers, use a local fake STUN server
and cover empty files, window boundaries, odd names, malformed
messages, session replacement and the production build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tracker codes now use 8 of [0-9a-zA-Z] instead of 8 digits. After both
security checks the receiver sees the offered file and starts the download
itself, the sender waits for it. Both sides show a progress bar of what the
download manager has read. Copy buttons for the tracker code, offer and
answer; the manual exchange is folded away below the tracker on both sides.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The security check compares 8 instead of 5 fingerprint bytes, too many to
brute force matching certificates. The tracker code has 8 digits, making
collisions between concurrent senders 100x less likely.
A "Codes don't match" button, or a peer leaving before the transfer
starts, ends that connection without ending the share: the tracker sender
answers the next (or a queued) offer, the receiver replaces its used up
offers. Both codes are aligned below each other.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Core in src/main.ts: manual SDP copy/paste exchange (default, no
tracker) and optional WebTorrent tracker signaling, STUN opt-out
- Fingerprint security check, sender confirms before sending
- ICE gathering stops after the first STUN result (5 s hard cap)
- Receiver writes to OPFS via an inline dedicated worker instead of RAM
- Playwright e2e suite across Chromium/Firefox and all signaling modes,
opt-in 2.5 GiB transfer test (pnpm test:large)
- TODO.md with review findings and the service worker plan
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>