Coder Social home page Coder Social logo

epoxy-tls's Introduction

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 } = await epoxy();
let client = await new EpoxyClient("wss://localhost:4000", navigator.userAgent, 10);

// 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] --pubkey <PUBKEY> --privkey <PRIVKEY>

Options:
      --prefix <PREFIX>    [default: ]
  -l, --port <PORT>        [default: 4000]
  -p, --pubkey <PUBKEY>    
  -P, --privkey <PRIVKEY>  
  -h, --help               Print help
  -V, --version            Print version

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

epoxy-tls's People

Contributors

r58playz avatar velzie avatar spencerpogo avatar foxmoss avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.