Closed chmorgan closed 6 months ago
This crate is out of date but the code is small enough for you to drop into your project.
https://github.com/FruitieX/dioxus-websocket-hooks/blob/master/src/lib.rs
The reqwest-websocket crate works too. https://crates.io/crates/reqwest-websocket
For my use case it was important that a web application be possible. As the application would be using web sockets, I was looking to see if that fit in with what dioxus might support. It's actually been a significant amount of effort, and thank you and @sjames for those links, to figure out how to do web sockets with wasm.
tokio-tungstenite wasm support would be awesome (https://github.com/tokio-rs/tokio/issues/1597) but doesn't appear to be in progress.
In any case, it could help others using dioxus if there was an example showing how to do cross platform web sockets.
My web app needs to handle data streamed from a web socket but I'm struggling to figure out how (or if this is possible with wasm targets).
An example of how to use web sockets with Dioxus would be helpful.