npm packaging

This commit is contained in:
CoolElectronics 2024-01-15 14:37:55 -05:00
parent 6e3f968f9c
commit 656eb67bfb
No known key found for this signature in database
GPG key ID: F63593D168636C50
9 changed files with 82 additions and 24 deletions

View file

@ -7,8 +7,8 @@ mod wrappers;
use tokioio::TokioIo;
use utils::{ReplaceErr, UriExt};
use wrappers::{IncomingBody, WsStreamWrapper};
use websocket::EpxWebSocket;
use wrappers::{IncomingBody, WsStreamWrapper};
use std::sync::Arc;
@ -17,7 +17,7 @@ use bytes::Bytes;
use futures_util::StreamExt;
use http::{uri, HeaderName, HeaderValue, Request, Response};
use hyper::{body::Incoming, client::conn::http1::Builder, Uri};
use js_sys::{Function, Array, Object, Reflect, Uint8Array};
use js_sys::{Array, Function, Object, Reflect, Uint8Array};
use penguin_mux_wasm::{Multiplexor, MuxStream};
use tokio_rustls::{client::TlsStream, rustls, rustls::RootCertStore, TlsConnector};
use tokio_util::{
@ -226,7 +226,10 @@ impl EpoxyClient {
protocols: Vec<String>,
origin: String,
) -> Result<EpxWebSocket, JsError> {
EpxWebSocket::connect(self, onopen, onclose, onerror, onmessage, url, protocols, origin).await
EpxWebSocket::connect(
self, onopen, onclose, onerror, onmessage, url, protocols, origin,
)
.await
}
pub async fn fetch(&self, url: String, options: Object) -> Result<web_sys::Response, JsError> {