Epoxy TLS lets you make fully encrypted HTTP and WebSocket requests directly from browser JavaScript by running TLS inside WebAssembly and tunneling TCP connections through the Wisp protocol. This guide walks you through installing the package, initializing the WASM module, and issuing your first proxiedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/MercuryWorkshop/epoxy-tls/llms.txt
Use this file to discover all available pages before exploring further.
fetch() call.
Before using any Epoxy class, you must call
init() and await its result. The way you call init() depends on which package export you import.import init, { EpoxyClient, EpoxyClientOptions } from "@mercuryworkshop/epoxy-tls";
// No arguments required — the WASM binary is already bundled
await init();
import init, { EpoxyClient, EpoxyClientOptions } from "@mercuryworkshop/epoxy-tls/epoxy";
// Pass the path or URL to the separately hosted .wasm file
await init({ module_or_path: "/path/to/epoxy.wasm" });
Use the bundled variant (
@mercuryworkshop/epoxy-tls or @mercuryworkshop/epoxy-tls/epoxy-bundled) during development and for simpler deployments — it requires no extra static file serving setup.Create an
EpoxyClientOptions object and configure it before constructing the client. Enabling wisp_v2 is strongly recommended for best compatibility and performance.const options = new EpoxyClientOptions();
options.user_agent = navigator.userAgent;
options.wisp_v2 = true;
Other available options include
udp_extension_required, disable_certificate_validation, redirect_limit, header_limit, and buffer_size. See the API reference for the full list.Pass your Wisp server URL (using the
ws:// or wss:// scheme) as the first argument to the EpoxyClient constructor, along with the options object you just configured.// Use your own self-hosted Wisp server in production
const client = new EpoxyClient("wss://wisp.mercurywork.shop", options);
EpoxyClient also accepts an async function instead of a URL string if you need a custom transport. The function must return { read: ReadableStream<ArrayBuffer>, write: WritableStream<Uint8Array> }. See the API reference for details.Call
client.fetch() just like the native browser fetch API. It returns a standard Response object whose headers, text(), json(), and arrayBuffer() methods all work as expected. An additional rawHeaders property exposes the raw header map.The demo Wisp server at
wss://wisp.mercurywork.shop is intentionally throttled and is provided for testing only. For production use, self-host a Wisp server and pass its URL to EpoxyClient.Complete example
The following snippet combines all of the steps above into a single, copy-pasteable module.Next steps
Fetch guide
Learn about request options, redirect handling, streaming bodies, and POST requests.
WebSocket guide
Open proxied WebSocket connections using
EpoxyHandlers and connect_websocket.API reference
Full reference for
EpoxyClient, EpoxyClientOptions, and EpoxyHandlers.