Files
HellCon/README.md
T
SchluffeandClaude Opus 5.5 ac4d496a48 Version the protocol for 1.0, fail downloads the page abandoned
PROTOCOL (hellcon/1) goes in front of the PBKDF2 salt and names the data
channel, so different versions never meet via a tracker and the manual
receiver tells a sender on another protocol apart. The footer shows it, the
receiver's hints ask to compare it. Forks are asked to name their own.

public/sw.js and the page exchange a VERSION, a mismatch fails the download
with outdated. The worker fails a download after 20 s without a chunk or
ping from its page, else Firefox saves the truncated file of a closed tab as
complete.

The build uses relative links and works under any path. On https only wss:
trackers and ws: to this device are accepted, one the browser refuses to
open counts as lost. Also: a file read short stops the transfer, an offer
waiting on a lost tracker isn't answered, a share ended while its key was
derived opens no tracker, and tracker and receiver errors lose hidden
characters. The README lists what isn't planned and the phone limitation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:10:09 +01:00

177 lines
9.1 KiB
Markdown

# HellCon
Send a file straight from one browser to another. No account, no upload, no app to install, and no
size limit: the file goes directly to the other person and is never stored on a server.
## How to send a file
1. **Sender:** open HellCon, drop a file onto the Send card and click **Share via tracker**. You get
an 11 character code. Tell it to the receiver, it works for 6 minutes. Whoever has the code can
get the file, or pretend to be you, so give it to nobody else.
2. **Receiver:** open HellCon, enter the code under Receive and click **Receive**.
3. **Receiver:** once connected, you see the file's name and size. Click **Download** to save it.
Keep both tabs open until the transfer is finished. Starting something new in a tab ends what that
tab was doing.
Both sides need the same protocol, shown at the bottom of the page. A HellCon hosted elsewhere may
run another one, the receiver then finds no sender, or with **Manual** says the sender runs another
protocol.
### Without a tracker
If you'd rather not use a tracker, open **Manual** on both sides. The sender creates an offer, a
long block of text, and sends it to the receiver any way you like, e.g. a chat or an email. The
receiver pastes it, creates an answer and sends that back. The sender pastes the answer and clicks
**Connect**. The offer and answer contain your network addresses, so only share them with the person
you're sending to. Both sides then compare the security check (see below) and click **Codes match**.
## The security check
Before anything is transferred, both sides make sure they are connected directly to each other and
not to someone who placed themselves in between.
With the code this happens by itself: each side proves to the other that it knows the code, tied
to the encryption keys of this very connection. Someone in between, or anyone else who doesn't
know the code, can't do that, and HellCon drops the connection and waits for the right one.
The manual exchange has no code, so there you compare yourselves. Once connected, both sides see two
codes: **You** and **Peer**. Compare them with the other person over a channel you already trust,
ideally a call or in person:
- your **You** must be their **Peer**, and
- your **Peer** must be their **You**.
If both match, you are connected directly to each other. If they don't, someone has placed
themselves in between: click **Codes don't match** and nothing is sent. Nothing is transferred before
both sides confirmed, so take the time to compare every character, not just the start and end.
The codes are taken from the encryption keys of the connection. Someone in between would need their
own keys, which show up as different codes.
## How it works
The file travels over a direct, encrypted WebRTC connection between the two browsers. To set that up,
the browsers need two things:
- **Finding each other.** The code puts both browsers into the same group on a public
[WebTorrent](https://webtorrent.io/) tracker, which only passes the connection details back and
forth. They are encrypted with the code, so the tracker can't read them, and neither can anyone
else in the group without the code. It never sees the file. With the manual exchange you play the
tracker yourself.
- **Reaching each other.** Most devices sit behind a router and don't know their public address.
A STUN server tells them. With **Use STUN** turned off no STUN server is contacted, which works
only on the same network or over a VPN.
On the receiving side, HellCon hands the incoming data to the browser's own download manager while
it arrives. That's why files larger than your memory work too, and why the download shows up in
your browser's download list.
HellCon uses no relay server. If both sides are behind very strict networks, e.g. some company or
mobile networks, a direct connection may not be possible. And a connection that works isn't
necessarily direct: the other side may name a relay of its own, and a STUN server that reports a
wrong address can put itself in between. Either only passes on encrypted data. The security check
makes sure the connection ends at the two of you.
## Privacy
- The file only goes to the person you connected with.
- 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. The tracker the
two of you meet on does see which addresses share with each other, and when. If that matters,
use your own tracker and STUN server, or the manual exchange.
- Nothing is kept: every reload starts with the default settings.
- Whoever hosts HellCon serves the code that runs in your browser. If you'd rather not trust that,
host your own (below).
## Settings
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. 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.
The code goes to the tracker mixed with a salt, which changes with the clock every 6 minutes (by UTC):
guessing codes ahead of time pays off for 6 minutes at most. The code's last character tells the
receiver which 6 minutes it was made in, so the two clocks may be up to 3 hours apart. Someone could
still guess ahead for a particular 6 minutes. If that worries you, turn on **Use own salt** on both
sides and enter the same salt, agreed on any way you like. **Generate** makes a random one. Nobody
can guess ahead for a salt they don't know.
Nothing of this is kept, a reload brings back the defaults.
## Host your own
HellCon is a static website, any web server can host it. Build it with Node.js and pnpm:
```sh
pnpm install
pnpm build
```
Then serve the `dist/` folder, with these requirements:
- **HTTPS.** Browsers only allow the parts HellCon needs on secure pages (`localhost` is fine for
trying it out).
- **`sw.js` next to `index.html`.** It streams the downloads. Requests to the `download/` path below
HellCon must reach it unchanged, so don't rewrite them to `index.html`. Any path works, e.g.
`https://example.org/hellcon/`, with the trailing slash: the page links its files relative to it,
so redirect `/hellcon` there.
Recommended, as response headers, a `<meta>` can't set them (`index.html` sets
`Referrer-Policy: no-referrer` and the rest of its Content-Security-Policy itself, which keeps out
scripts and styles from elsewhere but allows connections to any tracker):
```
Content-Security-Policy: frame-ancestors 'none'
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
```
The first two keep other sites from framing HellCon and laying their own page over its buttons,
`X-Frame-Options` for older browsers.
Your own tracker and STUN server are optional, any public ones work. `backend/` has both as Docker
Compose services: a tracker that only does what HellCon needs, with an Origin allowlist and limits,
and coturn as STUN server. `backend/compose.yaml` says how to set them up.
If you change how HellCon talks to the other side, e.g. the code, the encryption or the messages,
give `PROTOCOL` in `src/core.ts` a name of your own, e.g. `yourname/1`, and count up from there.
## Not planned
These were considered and decided against, please don't ask for them without a new reason. HellCon
is copy and paste a code, with public trackers and STUN servers. Anything that puts state in the URL,
needs infrastructure of its own or only helps small files doesn't pay off.
- **The code in a share link:** the code would end up in the browser history and wherever links get
handled, for one click less.
- **Another code alphabet,** e.g. one that ignores case or uses words: most people copy and paste
the code anyway.
- **Saving without the service worker,** holding the file in memory instead: useless for files of
several GB.
- **TURN servers or a relay-only mode:** too much infrastructure to host and test.
- **A longer or extendable share,** **several files as a zip,** and **resuming in Chromium:** not
for now.
- **Keeping a phone sending in the background,** e.g. with a silent audio loop: the sender's page
has to stay in front.
## Known limitations
- **Firefox:** if the sender disappears in the middle of a transfer, HellCon reports the failure,
but Firefox keeps showing the download as in progress until you cancel it.
- **Chromium:** notices a vanished sender only after about 16 seconds.
- An interrupted transfer can't be resumed, it starts over.
- **Phones:** the sender's page has to stay in front, the connection is lost once it goes to the
background. Receiving keeps going.
- Private windows may not allow the background part that saves downloads. Receiving then doesn't
work, and HellCon tells you so.
## License
MIT, see [LICENSE](LICENSE).