add wisp to client

This commit is contained in:
Toshit Chawda 2024-01-30 21:15:17 -08:00
parent be7d92b4c5
commit c5cf95fcb1
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
12 changed files with 210 additions and 320 deletions

View file

@ -101,7 +101,7 @@ async fn accept_http(
async fn handle_mux(
packet: ConnectPacket,
mut stream: MuxStream<impl ws::WebSocketWrite>,
mut stream: MuxStream<impl ws::WebSocketWrite + Send + 'static>,
) -> Result<bool, WispError> {
let uri = format!(
"{}:{}",
@ -174,9 +174,7 @@ async fn accept_ws(
println!("{:?}: connected", addr);
let mut mux = ServerMux::new(rx, tx);
mux.server_loop(&mut |packet, stream| async move {
ServerMux::handle(rx, tx, &mut |packet, stream| async move {
let mut close_err = stream.get_close_handle();
let mut close_ok = stream.get_close_handle();
tokio::spawn(async move {