Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hi. I read that UDP sockets aren't in WASM. Will this work as expected when targeting WASM with Rust? For additional context, I'm writing a Flutter application that uses a Rust library, which I'm also writing, that will implement a bespoke internet protocol. Thanks!

You must be logged in to vote

Replies: 2 comments · 2 replies

Comment options

It's not possible to use this with WASM as it exists in the context of the web. For WASM runtimes that support WASI or some other way to perform socket IO it might be possible.

If you can implement UDP socket I/O you can provide a muxed connection via SettingEngine::set_udp_network.

You must be logged in to vote
2 replies
@walterjj
Comment options

Does that mean it should work in a node.js server context?

@teohhanhui
Comment options

The webrtc / webrtc-* crates currently use tokio's "net" feature, which does not work on the wasm32-wasip2 target:

rust-lang/rust#130323

And even when tokio-rs/tokio#6893 is merged, it still won't work on stable Rust:

rust-lang/rust#130323 (comment)

Comment options

While not an answer to your actual question, maybe some other folks would like to know an alternative solution to this problem:

When talking about Browsers as WASM target, they already ship with webrtc. You can implement your browser client application using rust-wasm and then interop to the JS webrtc API for webrtc scenarios. Admittedly not a perfect solution, but it's what we got in browsers at the moment.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.