An encrypted proxy for browser javascript http://epoxy.r58playz.dev/
Find a file
2024-03-30 10:35:56 -07:00
.cargo tests 2024-03-23 10:05:17 -07:00
.github/workflows Install wasm-bindgen-cli in CI 2024-03-23 10:18:18 -07:00
client use upstream pki-types 2024-03-30 03:07:15 -07:00
server remove frame_size as that is causing issues 2024-03-29 13:51:48 -07:00
simple-wisp-client exit on error, remove debug print 2024-03-30 10:35:56 -07:00
wisp remove the mutex<hashmap> in wisp_mux, other improvements 2024-03-26 18:55:54 -07:00
.envrc nixification 2024-01-09 19:46:05 -08:00
.gitignore clean up build.sh, license as LGPL 2024-03-02 17:40:22 -08:00
Cargo.lock use upstream pki-types 2024-03-30 03:07:15 -07:00
Cargo.toml use upstream pki-types 2024-03-30 03:07:15 -07:00
flake.lock nixification 2024-01-09 19:46:05 -08:00
flake.nix nixification 2024-01-09 19:46:05 -08:00
README.md unix sockets 2024-03-09 14:21:13 -08:00

epoxy

Epoxy is an encrypted proxy for browser javascript. It allows you to make requests that bypass CORS without compromising security, by running SSL/TLS inside webassembly.

Using the client

Epoxy must be run from within a web worker and must be served with the security headers needed for SharedArrayBuffer. Here is a simple usage example:

import epoxy from "./epoxy-module-bundled.js";
// or
// importScripts("epoxy-bundled.js");

const { EpoxyClient, certs } = await epoxy();

let client = await new EpoxyClient("wss://localhost:4000", navigator.userAgent, 10);

// You can view the certificates compiled in
console.log(certs())

// You can view and change the user agent and redirect limit
console.log(client.userAgent);
client.redirect_limit = 5;

let response = await client.fetch("https://httpbin.org/get");
console.log(await response.text());

See client/demo.js for more examples.

Using the server

$ cargo r -r --bin epoxy-server -- --help
Implementation of the Wisp protocol in Rust, made for epoxy.

Usage: epoxy-server [OPTIONS]

Options:
      --prefix <PREFIX>  [default: ]
  -p, --port <PORT>      [default: 4000]
  -b, --host <HOST>      [default: 0.0.0.0]
  -u, --unix-socket      
  -h, --help             Print help
  -V, --version          Print version

You can listen on a unix socket by passing the --unix-socket flag and the unix socket path in the --host flag. Example:

cargo r -r -- -u -b "/home/user/epoxy-socket"

Building

Important

Rust nightly is required.

Server

cargo b -r --bin epoxy-server

The executable will be placed at target/release/epoxy-server.

Client

Important

Building the client is only supported on Linux.

Make sure you have the wasm32-unknown-unknown rust target, the rust-std component, and the wasm-bindgen, wasm-opt, and base64 binaries installed.

In the client directory:

bash build.sh

To host a local server with the required headers:

python3 serve.py