mix-fetch
@nymproject/mix-fetch (opens in a new tab) routes HTTP and HTTPS through the Nym mixnet behind the browser fetch (opens in a new tab) signature: mixFetch(url, init) returns the same Response you would get from fetch(url, init). The request travels mixnet hops first, exits at an IPR (Internet Packet Router) gateway, and reaches the destination with the IPR's IP, not yours. It is not a perfect substitute for fetch: no cookies or credentials, no HTTP cache, no AbortController, and HTTPS-only in practice (plain HTTP is fully visible at the exit; see drop-in caveats).
┌────────────────────────────────────────────────────────────────────┐
│ Your browser app │
│ └─ mixFetch('https://...') │
│ └─ mix-tunnel (shared singleton, Web Worker, smolmix-wasm) │
│ └─ smoltcp userspace TCP/IP + rustls TLS │
│ └─ WebSocket to entry gateway │
│ └─ Nym mixnet (3 mix layers) │
│ └─ IPR exit gateway → destination │
└────────────────────────────────────────────────────────────────────┘TLS terminates end-to-end between the WASM bundle and the destination server. The IPR sees destination IP and port; for HTTPS targets, payload is TLS ciphertext.
In this section
- Get started: install and make your first mixnet request.
- Reference: request shape, default headers, drop-in caveats, configuration.
- Concepts & security: what the IPR exit sees.
- Migrating from v1.x: the v1 to v2 clean break.
- TypeDoc reference: generated from the source.
- Browser example (opens in a new tab): a runnable example app.