Awesome Open Source
Awesome Open Source


Asynchronous WebSockets for Tokio stack.

MIT licensed Build Status



Add this in your Cargo.toml:

tokio-tungstenite = "*"

Take a look at the examples/ directory for client and server examples. You may also want to get familiar with Tokio if you don't have any experience with it.

What is tokio-tungstenite?

This crate is based on tungstenite-rs Rust WebSocket library and provides Tokio bindings and wrappers for it, so you can use it with non-blocking/asynchronous TcpStreams from and couple it together with other crates from Tokio stack.


As with tungstenite-rs TLS is supported on all platforms using native-tls or rustls through the native-tls and rustls-tls feature flags. Neither is enabled by default. If you require support for secure WebSockets (wss://) enable one of them.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Rust (61,660
Websocket (5,251
Websocket (5,251
Asynchronous (1,270
Tokio (188
Related Projects