This commit is contained in:
CoolElectronics 2024-01-15 18:01:16 -05:00
parent 0d6bb2e8ba
commit 48e9836515
No known key found for this signature in database
GPG key ID: F63593D168636C50
2 changed files with 19 additions and 7 deletions

View file

@ -1,4 +1,19 @@
# epoxy # 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.
Simple usage example for making a secure GET request to httpbin.org:
```javascript
import epoxy from "@mercuryworkshop/epoxy-tls";
const { EpoxyClient } = await epoxy();
let client = await new EpoxyClient("wss://localhost:4000", navigator.userAgent, 10);
let response = await client.fetch("https://httpbin.org/get");
await response.text();
```
Epoxy also allows you to make arbitrary end to end encrypted TCP connections safely directly from the browser.
## Building ## Building
@ -8,6 +23,7 @@
2. Run `cargo r --bin epoxy-server`, optionally with `-r` flag for release 2. Run `cargo r --bin epoxy-server`, optionally with `-r` flag for release
### Client ### Client
Note: Building the client is only supported on linux
1. Make sure you have the `wasm32-unknown-unknown` target installed, `wasm-bindgen` and `wasm-opt` executables installed, and `bash`, `python3` packages (`python3` is used for `http.server` module) 1. Make sure you have the `wasm32-unknown-unknown` target installed, `wasm-bindgen` and `wasm-opt` executables installed, and `bash`, `python3` packages (`python3` is used for `http.server` module)
2. Run `bash build.sh` to build without wasm-opt and start a webserver 2. Run `pnpm build`

View file

@ -1,6 +1,6 @@
{ {
"name": "@mercuryworkshop/epoxy-tls", "name": "@mercuryworkshop/epoxy-tls",
"version": "1.0.1", "version": "1.0.2",
"description": "A wasm library for using raw encrypted tls/ssl/https/websocket streams on the browser", "description": "A wasm library for using raw encrypted tls/ssl/https/websocket streams on the browser",
"scripts": { "scripts": {
"build": "cd client && ./build.sh" "build": "cd client && ./build.sh"
@ -19,9 +19,5 @@
"browser": "./client/module.js", "browser": "./client/module.js",
"module": "./client/module.js", "module": "./client/module.js",
"main": "./client/module.js", "main": "./client/module.js",
"types": "./client/module.d.ts", "types": "./client/module.d.ts"
"devDependencies": {
"esbuild": "^0.19.11",
"esbuild-plugin-wasm": "^1.1.0"
}
} }