preliminary support for wisp v2

This commit is contained in:
Toshit Chawda 2024-04-11 19:05:14 -07:00
parent 98072be3d4
commit ef5ed52e71
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
18 changed files with 772 additions and 206 deletions

View file

@ -105,7 +105,7 @@ pub fn certs() -> Result<JsValue, JsValue> {
#[wasm_bindgen(inspectable)]
pub struct EpoxyClient {
rustls_config: Arc<rustls::ClientConfig>,
mux: Arc<RwLock<ClientMux<WebSocketWrapper>>>,
mux: Arc<RwLock<ClientMux>>,
hyper_client: Client<TlsWispService, HttpBody>,
#[wasm_bindgen(getter_with_clone)]
pub useragent: String,
@ -164,7 +164,7 @@ impl EpoxyClient {
async fn get_tls_io(&self, url_host: &str, url_port: u16) -> Result<EpxIoTlsStream, JsError> {
let channel = self
.mux
.read()
.write()
.await
.client_new_stream(StreamType::Tcp, url_host.to_string(), url_port)
.await