mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-12 14:00:01 -04:00
use h2-wasm
This commit is contained in:
parent
ee08a10e10
commit
065de8e85f
7 changed files with 33 additions and 9 deletions
19
Cargo.lock
generated
19
Cargo.lock
generated
|
@ -683,7 +683,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "epoxy-client"
|
||||
version = "2.1.13"
|
||||
version = "2.1.14"
|
||||
dependencies = [
|
||||
"async-compression",
|
||||
"async-trait",
|
||||
|
@ -699,6 +699,7 @@ dependencies = [
|
|||
"http-body-util",
|
||||
"hyper",
|
||||
"hyper-util-wasm",
|
||||
"instant",
|
||||
"js-sys",
|
||||
"parking_lot_core",
|
||||
"pin-project-lite",
|
||||
|
@ -1015,8 +1016,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "h2"
|
||||
version = "0.4.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205"
|
||||
source = "git+https://github.com/r58Playz/h2-wasm#5f06b28102b5e41771c5e3951bfffe8acba9da56"
|
||||
dependencies = [
|
||||
"atomic-waker",
|
||||
"bytes",
|
||||
|
@ -1025,6 +1025,7 @@ dependencies = [
|
|||
"futures-sink",
|
||||
"http",
|
||||
"indexmap 2.6.0",
|
||||
"instant",
|
||||
"slab",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
|
@ -1297,6 +1298,18 @@ dependencies = [
|
|||
"hashbrown 0.15.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "instant"
|
||||
version = "0.1.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ipconfig"
|
||||
version = "0.3.2"
|
||||
|
|
|
@ -11,3 +11,4 @@ opt-level = 3
|
|||
|
||||
[patch.crates-io]
|
||||
fastwebsockets = { git = "https://github.com/r58Playz/fastwebsockets" }
|
||||
h2 = { git = "https://github.com/r58Playz/h2-wasm" }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "epoxy-client"
|
||||
version = "2.1.13"
|
||||
version = "2.1.14"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
|
@ -50,6 +50,10 @@ features = ["web"]
|
|||
version = "*"
|
||||
features = ["nightly"]
|
||||
|
||||
[dependencies.instant]
|
||||
version = "*"
|
||||
features = ["wasm-bindgen"]
|
||||
|
||||
[features]
|
||||
default = ["full"]
|
||||
full = ["dep:fastwebsockets", "dep:async-compression", "dep:rustls-webpki", "dep:rustls-pemfile", "hyper-util-wasm/http2"]
|
||||
|
|
|
@ -30,7 +30,7 @@ else
|
|||
fi
|
||||
|
||||
mv out/epoxy_client_bg.wasm out/epoxy_client_unoptimized.wasm
|
||||
wasm-opt --signext-lowering out/epoxy_client_unoptimized.wasm -o out/epoxy_client_lowered.wasm
|
||||
wasm-opt $WASMOPTFLAGS --signext-lowering out/epoxy_client_unoptimized.wasm -o out/epoxy_client_lowered.wasm
|
||||
|
||||
if [ "${RELEASE:-0}" = "1" ]; then
|
||||
(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@mercuryworkshop/epoxy-tls",
|
||||
"version": "2.1.13-1",
|
||||
"version": "2.1.14-1",
|
||||
"description": "A wasm library for using raw encrypted tls/ssl/tcp/udp/https/websocket streams on the browser",
|
||||
"scripts": {
|
||||
"build": "./build.sh"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
set -euo pipefail
|
||||
shopt -s inherit_errexit
|
||||
|
||||
export RELEASE=1
|
||||
export RELEASE="${RELEASE:-1}"
|
||||
|
||||
rm -r full minimal || true
|
||||
|
||||
|
|
|
@ -424,10 +424,16 @@ impl EpoxyClient {
|
|||
};
|
||||
|
||||
let service = StreamProviderService(stream_provider.clone());
|
||||
let client = Client::builder(WasmExecutor)
|
||||
let mut builder = Client::builder(WasmExecutor);
|
||||
builder
|
||||
.http09_responses(true)
|
||||
.http1_title_case_headers(options.title_case_headers)
|
||||
.http1_max_headers(options.header_limit)
|
||||
.http1_max_headers(options.header_limit);
|
||||
|
||||
#[cfg(feature = "full")]
|
||||
builder
|
||||
.http2_max_concurrent_reset_streams(10); // set back to default, on wasm it is 0
|
||||
let client = builder
|
||||
.build(service);
|
||||
|
||||
Ok(Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue