Hi, is there any support for using Server Sent Events (SSE) with rust to webassembly on the client side? The websys crate has web_sys::EventSource
which enables this by using JavaScript interop, but I can't find anything similar when using the wit-bindgen crate. There are a few crates for using SSE in pure rust here: https://crates.io/keywords/server-sent-events. But when I try to include any of them as a dependency in the Cargo.toml
file, I get compilation errors.
wasm-bindgen and by extension web-sys is for usage in the browser and allows you to bind to arbitrary javascript api's. wit-bindgen can be used in the browser, but you are yourself responsible for writing the glue code with the browser api's in that case.
The crates you are referencing are for usage of server sent events as client outside of the browser.
I see, the idea was to use client server sent events outside of the browser with webassembly. But as I understand, this kind of networking is not yet supported.
Last updated: Nov 22 2024 at 16:03 UTC