Stream: general

Topic: Webrtc


view this post on Zulip blender man (Jul 28 2025 at 21:42):

Is there any webrtc library that supports compiling to wasi? Webrtc rust is not compiling because of socket2 and tokio. I need to impleament realtime audio communication.

view this post on Zulip Jeff Parsons (Jul 29 2025 at 01:58):

I don't think so. (Don't take that as definitive.) For now at least I would suggest managing the WebRTC connection in JavaScript and ferry bytes across the JS/Wasm boundary.

view this post on Zulip Victor Adossi (Jul 29 2025 at 09:51):

Note that there are some examples of tokio that do work with wasi:sockets:

https://github.com/tokio-rs/tokio/pull/6893

There are other prototypes and experiments out there, but you may be able to get sockets & tokio working

Motivation This adds support for the new wasm32-wasip2 target platform, which includes more extensive support for sockets than wasm32-wasip1 (formerly known as wasm32-wasi). Solution The bulk of ...

view this post on Zulip Ludea (Jul 29 2025 at 10:16):

There is also https://gist.github.com/pimeys/856846ff8718247d79f1557ed82d80f7

GitHub Gist: instantly share code, notes, and snippets.

view this post on Zulip Ralph (Jul 29 2025 at 12:01):

in short, we await v0.3.0.x for direct compilation here.

view this post on Zulip Joel Dice (Jul 29 2025 at 13:50):

Ralph said:

in short, we await v0.3.0.x for direct compilation here.

I doubt 0.3.x will make any difference regarding wasi-sockets support in mio, tokio and socket2. There are no technical obstacles to supporting WASIp2 sockets in any of those libraries, and I don't expect WASIp3 sockets to be significantly more or less difficult to support in comparison. What might help is WASI 1.0, though -- it would be a sign of stability and make the platform more attractive to library maintainers.

view this post on Zulip blender man (Jul 29 2025 at 22:56):

Thank you for the suggestions and in my case where I am using wasm components as plugins and wasmtime as host and I cant really use web or host implementations but the good thing is as suggested, I can use the forks of tokio and socket2 which works with wasi sockets and by using them hopefully I should able to compile webrtc crate, which is perfect for my case as I needed plugin only implementation and using custom forks should be fine temporarily as I am using it for demo purposes only, tho it would be great if they get merged in crates itself.

view this post on Zulip Victor Adossi (Jul 30 2025 at 06:49):

Would be great if you shared that progress here (whatever you can open source) -- I'm sure people would love to :eye: :eye: the code!

view this post on Zulip blender man (Jul 30 2025 at 15:08):

I am not able to compile webrtc because of udp sockets, is udp not implemented yet for mio and tokio?

view this post on Zulip Joel Dice (Jul 30 2025 at 15:16):

Sorry, no -- my mio PR only supports TCP sockets so far. Adding UDP support should be straightforward, though -- it's supported in wasi-libc, so it should just be a matter of hooking that up to mio.

view this post on Zulip blender man (Jul 31 2025 at 08:36):

Ah, that's unfortunate-but makes sense. Honestly, I'm not super deep into sockets or wasi-libc myself, so I might be missing some of the knowledge required there. If anyone more familiar with this stuff is up for it, a PR adding UDP support would be massively appreciated!


Last updated: Dec 06 2025 at 05:03 UTC