Websocket crate?

I need websocket client crate to connect to server.

I want:

  1. async/std::future support
  2. based on modern tokio
  3. usage of SSL via the same library as reqwest (native-tls)

is any such library around?

There's a bunch. Have a look:

https://lib.rs/web-programming/websocket

I obviosly did some reaseach before asking. For example the first three in search list:

  1. ws uses mio, not tokio, I am not sure whether I need to write some specific
    code to use Future + tokio
  2. tungstenite promise that all possible (sync and async), but there is no example with tokio or async,
    so it is unclear whether it is really possible
  3. websocket (obsolete)

so no one really perfactly fit to my question,
and I would be intersting in real user experience of somebody who use some of this crates
in parallel with tokio/hyper.

1 Like

I'd recommend https://crates.io/crates/tokio-tungstenite. While I don't have experience using it with Hyper, we're using it with an intensive application that's built using Tokio and it's fit perfectly. There are examples of using it in their repository https://github.com/snapview/tokio-tungstenite/tree/master/examples.

4 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.