Awesome Open Source
Awesome Open Source

tokio-tungstenite

Asynchronous WebSockets for Tokio stack.

MIT licensed Crates.io Build Status

Documentation

Usage

Add this in your Cargo.toml:

[dependencies]
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.

Features

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