#websocket #io #web #tokio #async-std


Async binding for Tungstenite, the Lightweight stream-based WebSocket implementation

9 unstable releases (3 breaking)

✓ Uses Rust 2018 edition

new 0.4.2 Mar 25, 2020
0.4.1 Mar 24, 2020
0.4.0 Feb 1, 2020
0.3.1 Jan 6, 2020
0.1.1 Nov 29, 2019

#4 in WebSocket

Download history 116/week @ 2019-12-02 275/week @ 2019-12-09 107/week @ 2019-12-16 40/week @ 2019-12-23 61/week @ 2019-12-30 326/week @ 2020-01-06 258/week @ 2020-01-13 253/week @ 2020-01-20 314/week @ 2020-01-27 170/week @ 2020-02-03 317/week @ 2020-02-10 426/week @ 2020-02-17 432/week @ 2020-02-24 863/week @ 2020-03-02 1140/week @ 2020-03-09 779/week @ 2020-03-16

1,902 downloads per month
Used in 5 crates

MIT license

1.5K SLoC


Asynchronous WebSockets for async-std, tokio, gio and any std Futures runtime.

MIT licensed Crates.io Build Status



Add this in your Cargo.toml:

async-tungstenite = "*"

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

What is async-tungstenite?

This crate is based on tungstenite Rust WebSocket library and provides async bindings and wrappers for it, so you can use it with non-blocking/asynchronous TcpStreams from and couple it together with other crates from the async stack. In addition, optional integration with various other crates can be enabled via feature flags

  • async-tls: Enables the async_tls module, which provides integration with the async-tls TLS stack and can be used independent of any async runtime.
  • async-std-runtime: Enables the async_std module, which provides integration with the async-std runtime.
  • async-native-tls: Enables the additional functions in the async_std module to implement TLS via async-native-tls.
  • tokio-runtime: Enables the tokio module, which provides integration with the tokio runtime.
  • tokio-tls: Enables the additional functions in the tokio module to implement TLS via tokio-tls.
  • gio-runtime: Enables the gio module, which provides integration with the gio runtime.


Originally this crate was created as a fork of tokio-tungstenite and ported to the traits of the futures crate. Integration into async-std, tokio and gio was added on top of that.


~143K SLoC