A tracker message over 64 KiB isn't parsed, before acceptance it rejects the tracker like a failure reason. Beyond 20 messages per 10 s the rest is dropped, so a tracker can't keep the page parsing and decrypting. What a tracker makes a socket log goes through one note: each line once, at most 10 per socket. The log keeps the last 1000 lines in a shallow ref and says how many went. index.html sets Referrer-Policy itself, the README recommends the headers a <meta> can't set: frame-ancestors, X-Frame-Options and nosniff. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
147 lines
7.3 KiB
Markdown
147 lines
7.3 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.
|
|
|
|
### 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`.
|
|
|
|
Recommended, as response headers, a `<meta>` can't set them (`index.html` sets
|
|
`Referrer-Policy: no-referrer` itself):
|
|
|
|
```
|
|
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.
|
|
|
|
## 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.
|
|
- 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).
|