actually use hyper-util-wasm

This commit is contained in:
Toshit Chawda 2024-02-07 19:32:26 -08:00
parent 13d512a7b4
commit 8e75faeafd
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
4 changed files with 8 additions and 27 deletions

25
Cargo.lock generated
View file

@ -371,7 +371,7 @@ dependencies = [
"http", "http",
"http-body-util", "http-body-util",
"hyper", "hyper",
"hyper-util 0.1.3 (git+https://github.com/r58Playz/hyper-util-wasm)", "hyper-util-wasm",
"js-sys", "js-sys",
"pin-project-lite", "pin-project-lite",
"ring", "ring",
@ -400,7 +400,7 @@ dependencies = [
"futures-util", "futures-util",
"http-body-util", "http-body-util",
"hyper", "hyper",
"hyper-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-util",
"tokio", "tokio",
"tokio-native-tls", "tokio-native-tls",
"tokio-util", "tokio-util",
@ -449,7 +449,7 @@ dependencies = [
"base64", "base64",
"http-body-util", "http-body-util",
"hyper", "hyper",
"hyper-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-util",
"pin-project", "pin-project",
"rand", "rand",
"sha1", "sha1",
@ -727,25 +727,6 @@ dependencies = [
"tokio", "tokio",
] ]
[[package]]
name = "hyper-util"
version = "0.1.3"
source = "git+https://github.com/r58Playz/hyper-util-wasm#ea9a5608f3255562d4a647a5c94ff7d3f9c32b53"
dependencies = [
"bytes",
"futures-channel",
"futures-util",
"http",
"http-body",
"hyper",
"pin-project-lite",
"tower",
"tower-service",
"tracing",
"wasm-bindgen",
"wasmtimer",
]
[[package]] [[package]]
name = "hyper-util-wasm" name = "hyper-util-wasm"
version = "0.1.3" version = "0.1.3"

View file

@ -28,7 +28,7 @@ base64 = "0.21.7"
wisp-mux = { path = "../wisp", features = ["ws_stream_wasm", "tokio_io", "hyper_tower"] } wisp-mux = { path = "../wisp", features = ["ws_stream_wasm", "tokio_io", "hyper_tower"] }
async_io_stream = { version = "0.3.3", features = ["tokio_io"] } async_io_stream = { version = "0.3.3", features = ["tokio_io"] }
getrandom = { version = "0.2.12", features = ["js"] } getrandom = { version = "0.2.12", features = ["js"] }
hyper-util = { git = "https://github.com/r58Playz/hyper-util-wasm", features = ["client", "client-legacy", "http1", "http2"] } hyper-util-wasm = { version = "0.1.3", features = ["client", "client-legacy", "http1", "http2"] }
tokio = { version = "1.36.0", default-features = false } tokio = { version = "1.36.0", default-features = false }
tower-service = "0.3.2" tower-service = "0.3.2"
console_error_panic_hook = "0.1.7" console_error_panic_hook = "0.1.7"

View file

@ -18,7 +18,7 @@ use bytes::Bytes;
use futures_util::{stream::SplitSink, StreamExt}; use futures_util::{stream::SplitSink, StreamExt};
use http::{uri, HeaderName, HeaderValue, Request, Response}; use http::{uri, HeaderName, HeaderValue, Request, Response};
use hyper::{body::Incoming, Uri}; use hyper::{body::Incoming, Uri};
use hyper_util::client::legacy::Client; use hyper_util_wasm::client::legacy::Client;
use js_sys::{Array, Function, Object, Reflect, Uint8Array}; use js_sys::{Array, Function, Object, Reflect, Uint8Array};
use tokio_rustls::{client::TlsStream, rustls, rustls::RootCertStore, TlsConnector}; use tokio_rustls::{client::TlsStream, rustls, rustls::RootCertStore, TlsConnector};
use tokio_util::{ use tokio_util::{

View file

@ -168,8 +168,8 @@ where
} }
} }
impl<T> hyper_util::client::legacy::connect::Connection for TokioIo<T> { impl<T> hyper_util_wasm::client::legacy::connect::Connection for TokioIo<T> {
fn connected(&self) -> hyper_util::client::legacy::connect::Connected { fn connected(&self) -> hyper_util_wasm::client::legacy::connect::Connected {
hyper_util::client::legacy::connect::Connected::new() hyper_util_wasm::client::legacy::connect::Connected::new()
} }
} }