Correctly substituting Direct Sockets UDPSocket for mio UdpSocket

โš“ Rust    ๐Ÿ“… 2026-03-15    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 1      

surdeus

I have been working for a year trying to implement a WebTransport server in the browser using Direct Sockets UDPSocket Direct Sockets API and a QUIC/WebTransport implementation compiled to WASM or JavaScript.

I finally found this GitHub - birneee/quiche-wasm ยท GitHub which uses wasip2 and mio for UDP socket here quiche-wasm/apps/src/bin/quiche-server.rs at main ยท birneee/quiche-wasm ยท GitHub. That works WASM to WASM using wasmtime.

In previous attempts Direct Sockets UDPSocket quinn-wasm/src/direct_sockets.rs at direct-sockets ยท guest271314/quinn-wasm ยท GitHub and wasm-bindgen was used that didn't work quinn-wasm/src/direct_sockets.rs at direct-sockets ยท guest271314/quinn-wasm ยท GitHub.

Now I'm trying to substitute the wasm-bindgen mio UDP socket for the Direct Sockets UDPSocket interface, so I can do this

UDPSocket (raw bytes) =>
WASM QUIC state machine =>
Read unencrypted QUIC packets in JavaScript =>
Send Uint8Array to QUIC state machine =>
Encrypted QUIC packets back in JavaScript =>
Send/write back to client over UDPSocket

Additionally, since the certificates expire in 14 days, it would be useful to be able to send the certificate and key to the WASM QUIC state machine from JavaScript.

I know, there's a few things going on. Nothing Rustaceans can't make so given the inclination to do so.

Any help will be appreciated. Thanks.

1 post - 1 participant

Read full topic

๐Ÿท๏ธ Rust_feed