mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-12 14:00:01 -04:00
remove atomics / bulk-memory requirement
This commit is contained in:
parent
f5b50bcc98
commit
cc21e6c4a2
3 changed files with 5 additions and 15 deletions
|
@ -2,7 +2,7 @@
|
|||
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`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#security_requirements). Here is a simple usage example:
|
||||
Here is a simple usage example:
|
||||
```javascript
|
||||
import epoxy from "./epoxy-module-bundled.js";
|
||||
|
||||
|
@ -37,7 +37,7 @@ In the `client` directory:
|
|||
bash build.sh
|
||||
```
|
||||
|
||||
To host a local server with the required headers:
|
||||
To host a local server:
|
||||
```
|
||||
python3 serve.py
|
||||
python3 -m http.server
|
||||
```
|
||||
|
|
|
@ -12,7 +12,7 @@ else
|
|||
CARGOFLAGS=""
|
||||
fi
|
||||
|
||||
RUSTFLAGS='-C target-feature=+atomics,+bulk-memory -Zlocation-detail=none' cargo build --target wasm32-unknown-unknown -Z build-std=panic_abort,std -Z build-std-features=panic_immediate_abort,optimize_for_size --release $CARGOFLAGS "$@"
|
||||
RUSTFLAGS='-Zlocation-detail=none' cargo build --target wasm32-unknown-unknown -Z build-std=panic_abort,std -Z build-std-features=panic_immediate_abort,optimize_for_size --release $CARGOFLAGS "$@"
|
||||
echo "[epx] cargo finished"
|
||||
wasm-bindgen --target web --out-dir out/ ../target/wasm32-unknown-unknown/release/epoxy_client.wasm
|
||||
echo "[epx] wasm-bindgen finished"
|
||||
|
@ -27,7 +27,7 @@ if [ "${RELEASE:-0}" = "1" ]; then
|
|||
mv out/epoxy_client_bg.wasm out/epoxy_client_unoptimized.wasm
|
||||
(
|
||||
G="--generate-global-effects"
|
||||
time wasm-opt $WASMOPTFLAGS --enable-threads --enable-bulk-memory \
|
||||
time wasm-opt $WASMOPTFLAGS \
|
||||
out/epoxy_client_unoptimized.wasm -o out/epoxy_client_bg.wasm \
|
||||
--converge \
|
||||
$G --type-unfinalizing $G --type-ssa $G -O4 $G --flatten $G --rereloop $G -O4 $G -O4 $G --type-merging $G --type-finalizing $G -O4 \
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
from http.server import HTTPServer, SimpleHTTPRequestHandler, test
|
||||
import sys
|
||||
|
||||
class RequestHandler (SimpleHTTPRequestHandler):
|
||||
def end_headers (self):
|
||||
self.send_header('Cross-Origin-Opener-Policy', 'same-origin')
|
||||
self.send_header('Cross-Origin-Embedder-Policy', 'require-corp')
|
||||
SimpleHTTPRequestHandler.end_headers(self)
|
||||
|
||||
test(RequestHandler, HTTPServer, port=int(sys.argv[1]) if len(sys.argv) > 1 else 8000)
|
Loading…
Add table
Add a link
Reference in a new issue