I think you are looking for Media Over QUIC
https://github.com/moq-dev/moq. A whole buncha work has already been done.
Just because it had not been done, yet, and somebody over in Google world said it could be done, I went ahead and implemented a TLS+QUIC+WebTransport server state machine written in Zig compiled to WASM using Direct Sockets UDPSocket
https://github.com/guest271314/webtransport/tree/wasm. That's a WebTransport **server** _in the browswer_
I also transpiled that WASM code to JavaScript using wasm2js and wasm2lang
https://github.com/guest271314/webtransport/tree/js. A JavaScript runtime agnostic WebTransport server implementation that can be run using Node.js, Deno, Bun, and txiki.js
https://github.com/guest271314/webtransport/tree/runtime-agnostic.
WebTransport is non-trivial. Technically, you can use WebRTC Data Channel to establish a communication channel with an IWA window from ab arbitrary window/tab, then pipe that data to UDPSocket or TCPSocket for raw socket communication, and in theory run your own public server from a browser tab; do P2P stuff; etc.
https://github.com/guest271314/sockets.
Depending on the application, WebSocketStream might be sufficient. It's easy to look at both WebRTC and QUIC and WebTransport being over-engineered, and not really needed for all applications.