Docs
Security and privacy
What Hopwire stores and where, what the edge and the control plane see and log, what private mode guarantees and where it stops, the threat model in plain words, and how to report a vulnerability.
Hopwire has two modes, and they make different promises. Every tunnel prints its mode as its first line, so you always know which one applies.
Private mode (the default): No account, no servers of ours, end-to-end encrypted between you and the teammates you choose.
Public mode (--public): a public URL through the edge. It needs an account, and requests pass through the edge on their way to your machine.
The short version:
- Captured traffic is stored on your disk and nowhere else, unless you share the log with teammates.
- The edge and the control plane never store request or response content.
- There is no telemetry in either mode.
- Captured traffic is not redacted. The log holds headers and bodies as they arrived, credentials included.
What is stored on your machine
Everything lives in one data directory: ~/.hopwire, or $HOPWIRE_HOME, or the path you pass with --data-dir <path>.
| Path | What it holds | Mode | Created by |
|---|---|---|---|
store/ |
The traffic log (a Hypercore in a Corestore) and its key material. In hopwire watch, also the copy of the teammate's log |
directory 0700, set again on every start |
every tunnel, hopwire watch |
identity.json |
The Ed25519 key pair of this machine: publicKey and secretKey as hex |
0600 |
hopwire id, --share, hopwire connect, hopwire watch |
config.json |
The API token and the URL of the control plane it belongs to | 0600 |
hopwire login |
A data directory that has to be created is created with mode 0700. identity.json and config.json are written complete or not at all, and their mode is set back to 0600 every time they are read, so a file that was copied or restored with wider permissions is repaired on the next use.
$ ls -la ~/.hopwire
A plain hopwire http <port> creates no identity. identity.json appears the first time you run hopwire id, share, connect or watch.
The traffic log
Every request that passes through a tunnel is appended to the log as one entry: method, path with query string, all request and response headers, both bodies, status, duration, a timestamp, the service name and where the request came in (local, p2p_peer, public_edge or replay).
- Bodies are captured up to 2 MB each. Larger bodies are still forwarded in full; the log keeps the first 2 MB and marks the body as truncated.
- Nothing is redacted.
Authorizationheaders, cookies, API keys and webhook signatures are stored as captured. This is what makes a replay of a signed webhook faithful, and it is the reason to treat the data directory like a file of secrets. - WebSockets: the opening handshake is logged as one entry with status 101 and the headers of both sides. The messages that follow are not recorded.
- Requests that were given up before the answer was complete (the client hung up, the edge cancelled) are not logged.
- The log is not encrypted on disk. It is protected by the file modes above and by whatever disk encryption your machine uses.
- There is one log per data directory. Every run in that directory appends to it, and it has no expiry.
There is no command that deletes the log. To delete it, stop every tunnel that uses the data directory and remove store/:
$ rm -r ~/.hopwire/store
The next start creates an empty log with a new log key. Use a separate log for a sensitive project with --data-dir:
$ hopwire http 3000 --data-dir ./.hopwire-project
The identity
identity.json is this machine's key pair. The public key is what hopwire id prints, what a teammate passes to hopwire connect, and what they put on your allowlist. Anyone who has the secret key can act as this machine towards your teammates. A damaged identity file is refused, never replaced silently.
The API token
hopwire login reads the token from HOPWIRE_TOKEN or from a hidden prompt, checks it with the control plane, and stores it in config.json only when the control plane accepted it. The token is never printed, not in errors either.
$ hopwire login
$ hopwire logout
hopwire logout removes the token from config.json and keeps the URL of the control plane. It contacts nobody, so the token stays valid until you revoke it on the API tokens page of the control plane. The output says so.
The token is sent to the control plane it was stored with and to nothing else: --api must be https:// unless the control plane runs on this machine, redirects are not followed, and the edge never receives the API token.
hopwire.yaml
services.<name>.auth.basic holds user:password in clear text. Keep a hopwire.yaml with credentials out of version control. The credentials are never printed, and an error about the field does not repeat its value.
What leaves your machine
| You run | Network connections |
|---|---|
hopwire http <port>, hopwire up without p2p.share and without a public service |
None beyond loopback |
hopwire id, hopwire logout |
None |
--share, p2p.share: true, hopwire connect, hopwire watch |
The public HyperDHT, and direct connections to your teammates |
--public, a service with public: true |
The edge, and the control plane of your login for connect tokens |
hopwire login |
The control plane you name with --api (else the one of your last login, else https://hopwire.to), once |
A tunnel that opens nothing but loopback says so:
Mode private (local only, no network connection beyond loopback)
Private mode never contacts the edge or the control plane. A login stored on the machine is not even read unless a tunnel is public.
No telemetry
No analytics, no update check and no crash report leaves the machine, in either mode. The CLI does not phone home on start, on error or on exit. The inspector loads nothing from other hosts.
Private mode
No account, no servers of ours, end-to-end encrypted between you and the teammates you choose.
Sharing is opt-in, per run:
$ hopwire http 3000 --share
This prints two keys. They do different things:
- Peer key: the public key of your machine. A teammate uses it with
hopwire connect <peer-key> --port <port>to reach your local service. - Log key (the
Traffic logline): whoever has it can replicate your traffic log withhopwire watch <log-key>.
What it guarantees
- Connections run directly between the two machines over HyperDHT and are encrypted with Noise between your key and your teammate's key. There is no server of ours in the path and no relay.
- A teammate's log is read-only on the watcher's side. Replays in
hopwire watchgo to the watcher's own--replay-targeton loopback and are written to the watcher's own log, never to yours. - With an allowlist, every other key is refused before it can exchange a byte with your service or your log:
$ hopwire id
$ hopwire http 3000 --share --allow <pubkey-of-teammate>
--allow can be given several times. In hopwire.yaml the same list is p2p.allow. It applies to both hopwire connect and hopwire watch.
Where it stops
Read these before you share. The CLI prints the first three as a one-line Notice every time you do.
- Teammates with the log key see everything captured. Headers and bodies as captured, including credentials.
- The shared log is the whole log of the data directory, earlier runs included, whether those runs were shared or not. If the directory holds traffic your teammate should not see, share from a fresh one with
--data-dir. - Without
--allow, the peer key is not a secret. Sharing announces it to the DHT, whose nodes see it, and anyone who knows it can reach the shared service. Without--allow, anyone with the log key can read the log. - DHT nodes see metadata. The nodes of the public HyperDHT see IP addresses, public keys and discovery keys. They never see content, and a discovery key does not reveal the log key.
- Your teammate learns your IP address, and you learn theirs. The connection is direct.
- Sharing cannot be taken back.
hopwire watchdownloads the whole log to the watcher's disk. Stopping your tunnel stops new entries from reaching them; it does not remove their copy. - No relay. When no direct connection is possible, the CLI says so and exits. It does not fall back to a server.
- A public tunnel is not private.
--publictogether with--shareprintsMode public and private P2P, and the private claim is not printed for it.
Public mode
Mode public (public URL through the edge; needs a token, requests pass through the edge)
Public mode is not end-to-end encrypted. The path of a request is: client, HTTPS to Cloudflare's edge, our Worker and one Durable Object per subdomain, a WebSocket that your CLI opened outbound, then plain HTTP to your service on loopback. The edge handles the request in memory to pass it on. The CLI refuses an edge URL that is not wss:// unless the edge runs on this machine, because the token travels in a header of the connect request.
Anyone who knows a public URL can send requests to your local service. A URL is not a secret. To put a password in front of it, set Basic Auth in hopwire.yaml:
version: 1
edge:
url: ws://127.0.0.1:8787
services:
api:
local: http://127.0.0.1:8080
public: true
auth:
basic: demo:change-me
The edge then answers 401 to every request without the right credentials, before the request reaches your machine. Such requests are not in your log. With the right credentials the Authorization header is removed, so your service and your log never see the password. The CLI sends the credentials to the edge once, with its connect request; the edge keeps only their SHA-256 hash, for as long as the tunnel is connected. Use a long random password.
What the edge sees
- Every public request and response in full, in transit, because it carries them.
- The connect token of your CLI and the subdomain it asks for.
What the edge stores
- No paths, no headers, no bodies, no WebSocket messages. Bodies are streamed through with a bounded window in memory.
- With the open socket of your CLI: the subdomain, the time it connected, the expiry of its token and, with Basic Auth, the hash of the credentials. With an account also the organisation id, its plan and limits, the time of the last public request (for the idle limit of Free) and what the tunnel has left of today's limits. This goes away with the connection.
- One timer per tunnel for the moment the token expires.
- Per organisation, with an account: the numbers of each UTC day (requests, bytes and in-flight time) and which subdomains of the organisation have a tunnel online. The numbers of a day are kept for 8 days, today included, then deleted. No paths, headers or bodies are part of them. Private mode never reaches the edge, so it is never counted.
What the edge logs
One JSON line per event, with these fields and nothing else: event, subdomain, reqId (a random id per request), status, durationMs, error (a code such as tunnel_offline), closeCode and meter (the name of a daily limit that was reached: requests, bytes or inflight).
Events: object_started, cli_connected, cli_replaced, cli_token_expired, cli_token_renewed, token_renew_refused, cli_disconnected, cli_idle_closed, connect_refused, tunnel_refused, limit_reached, ledger_unavailable, request, frame_refused, ws_closed, usage_answered, usage_refused.
Never paths, headers, bodies, WebSocket messages or close reasons. The Worker in front never reads a body.
Tokens
- API token (
hw_and 40 characters): identifies your account to the control plane, in the organisation it was created in. Shown once when you create it. It never goes to the edge. - Connect token: what the CLI shows the edge. The control plane signs it (Ed25519); it names one subdomain and is valid for 300 seconds. With an account it also carries the organisation, its plan and the plan's limits, so the edge enforces them without asking the control plane. The edge verifies the signature itself and never calls the control plane. The CLI renews it on the open connection.
- Revoking an API token on the API tokens page ends a running tunnel at its next renewal, at most 150 seconds later.
- A second tunnel on the same subdomain replaces the first one. That needs a valid token for that subdomain.
What your local service receives
The request as the client sent it, with the Host header unchanged, plus X-Forwarded-Host and X-Forwarded-Proto set by the CLI. Values a client sent for those two headers are replaced. Both are part of the logged request.
The control plane
The control plane is used by public mode only and sits outside the data path. It issues connect tokens and never sees a request to your tunnel.
It stores:
- Account: name, email address, a bcrypt hash of the password.
- API tokens: the name you gave it, a SHA-256 hash of the token, its first 8 characters for display, its status and when it was last used. The token itself is not stored and cannot be shown again.
- Organisations: the name, the members with their roles (owner, admin, member), and invitations (the invited email address, who invited, when, and the invitation's status). Names, API tokens, the plan and the usage belong to an organisation. Every account has a personal one.
- Subdomains: the fixed URL of each organisation, the names it reserved, and who reserved them. Revoked tokens and released names are marked, not erased, so a name is never given to another organisation.
- Plan and billing: the plan, the subscription's status and period, the Stripe customer and subscription ids, any coupon applied, the billing name and address, the email address for invoices, a VAT identification number or Leitweg-ID if you give one, the invoices issued, and the outcome of payment notifications from Stripe. Card details are entered on Stripe's pages and never reach the control plane.
- Usage: per organisation and UTC day, the numbers of requests, bytes and in-flight time that the control plane fetches from the edge every 5 minutes, and which limit emails went out. Numbers only, never paths, headers or bodies.
- Web sessions: the session cookie's record, with the IP address and user agent of the browser.
It logs one line per connect token it issues, with the user id, the organisation id, the id of the API token, the subdomain and the plan. Neither the API token nor the connect token is ever logged.
Sign-in, registration and password reset are rate limited; connect tokens are limited to 30 a minute per API token. A password reset revokes every active API token of the account and ends its other sessions.
There is no self-service account deletion yet. To have an account and its data removed, write to [email protected].
Plans, usage and billing
Public tunnels run under the plan of an organisation, and the edge enforces its limits:
- Usage is counted at the edge, in public mode only. The counters hold numbers per organisation per day: requests, bytes and in-flight time; the tunnels online are checked live. Every 5 minutes the control plane fetches the numbers of its organisations from the edge, with a request it signs, for the usage page and the limit emails. Never paths, headers or bodies. This is service metering, not telemetry: it happens on our edge for traffic that passes through it, and the CLI sends nothing extra. Private mode is never counted.
- At a limit the public URL answers
429until 00:00 UTC. There is no overage and nothing is charged for it. The usage page of the control plane shows the numbers the edge counted, as of the last fetch, and limit emails go to the owner and the admins of the organisation. - The Free plan shows a warning page in front of the public URL, only for page loads from a browser. Its "Continue" sets a cookie for 7 days, which the edge removes before the request reaches your service.
- Billing runs through Stripe. Card details are entered on Stripe's pages and do not reach the control plane, which keeps what it needs for the subscription and for invoices (see the list above).
The inspector
The inspector shows the traffic log in your browser at the address of the Inspector line, http://127.0.0.1:4040/<key>.
- It binds to
127.0.0.1only. There is no option to expose it. - It refuses requests whose
Hostheader is not its own loopback address and port (this stops DNS rebinding), and refuses state-changing requests from another origin. It sends no CORS headers, cannot be framed, and loads nothing from other hosts. - It has no login, but every path starts with an access key the CLI makes up at every start and prints only in the
Inspectorline; without it the inspector answers403. Whoever learns the address of a run (your terminal, your browser history, the arguments of a runningcurl) can read the log and trigger replays until the run ends.
Run without it:
$ hopwire http 3000 --no-inspect
Threat model
In plain words: what Hopwire is built to withstand, and what it is not.
Hopwire protects against
- Someone on the network between you and a teammate. Private connections are encrypted end to end. A network observer, a DHT node or a Wi-Fi operator sees that two addresses talk, not what they say.
- Strangers reaching a shared service, when you use
--allow. Keys that are not on the list are refused. - A web page you visit trying to read your inspector. The Host and Origin checks stop it.
- A hostile log. Every entry of a teammate's log is validated before it is listed, printed or replayed, and control characters are escaped before anything from another machine reaches your terminal.
- A leaked connect token. It is valid for 300 seconds and for one subdomain.
- A leaked control-plane database. It holds token hashes and password hashes, not tokens or passwords, and no traffic.
- Requests forged to look internal. A public client cannot set the edge's internal headers or the Basic Auth hash, and cannot choose
X-Forwarded-HostorX-Forwarded-Proto. - A token sent over an open connection. The CLI refuses
ws://andhttp://for anything that is not on this machine.
Hopwire does not protect against
- Someone with access to your user account or your disk. They can read the traffic log, the identity and the API token. The files are owner-only, not encrypted.
- Other programs and users on your machine. The entry point (default port 4041) and the local port of
hopwire connectlisten on loopback without a password; the inspector (default 4040) needs the access key of the run. - A teammate you gave the log key to. They see everything captured, and they keep their copy.
- Secrets inside the traffic. Nothing is redacted. If a request carries a production credential, the log carries it too, and so does every copy of a shared log.
- The public internet reaching a public URL. Without
auth.basic, anyone who learns the URL reaches your service. Hopwire does not filter, scan or authenticate public requests beyond that. - The edge itself. In public mode, Cloudflare and our Worker carry your traffic in clear. Do not send through a public tunnel what the edge must not see; use private mode for that.
- Metadata in private mode. DHT nodes see IP addresses, public keys and discovery keys.
- What a replay does. A replay sends a real request, with the captured headers, to your local service. If that service charges a card or sends an email, the replay does it again.
- Your local service. Hopwire forwards to loopback addresses only, but it does not harden what listens there.
Practical advice
- Use
--allowwhenever you share. - Share from a data directory that holds only what the teammate may see.
- Use test credentials and sandbox webhooks while a tunnel is public or shared.
- Put
auth.basicin front of a public URL that is not meant for a webhook sender. - Revoke an API token on the API tokens page when a machine is lost;
hopwire logoutalone does not revoke it.
Report a vulnerability
Write to [email protected]. Do not open a public issue for a security problem.
Include:
- what you found and which part it concerns (CLI, inspector, edge, control plane),
- the version (
hopwire --version) and your operating system, - steps to reproduce it, or a proof of concept,
- what an attacker could do with it.
Please do not test against tunnels, accounts or traffic that are not yours, and give us time to fix the problem before you publish it. We will confirm that we received your report and tell you what happens next.