Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do perform web socket IO from a Dioxus web app? An example would be helpful #2143

Closed
chmorgan opened this issue Mar 26, 2024 · 3 comments

Comments

@chmorgan
Copy link

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.

@jkelleyrtp
Copy link
Member

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

@sjames
Copy link

sjames commented Mar 27, 2024

The reqwest-websocket crate works too. https://crates.io/crates/reqwest-websocket

@chmorgan
Copy link
Author

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 (tokio-rs/tokio#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants