MercuryWorkshop / epoxy-tls

An encrypted proxy for browser javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 served with the security headers needed for SharedArrayBuffer. Here is a simple usage example:

import epoxy from "./epoxy-module-bundled.js";

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

let options = new EpoxyClientOptions();
options.user_agent = navigator.userAgent;

let client = await new EpoxyClient("wss://localhost:4000", options);

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

See client/demo.js for more examples.

Using the server

See the server readme.

Building

Server

See the server readme.

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

About

An encrypted proxy for browser javascript


Languages

Language:Rust 91.9%Language:JavaScript 5.3%Language:Shell 1.9%Language:Nix 0.4%Language:HTML 0.3%Language:Python 0.2%