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


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

14 releases (7 breaking)

0.8.0 Jul 27, 2020
0.7.0 Jun 29, 2020
0.4.2 Mar 25, 2020
0.2.1 Dec 12, 2019
0.2.0 Nov 29, 2019

#4 in WebSocket

Download history 2123/week @ 2020-06-03 2107/week @ 2020-06-10 3180/week @ 2020-06-17 2669/week @ 2020-06-24 2703/week @ 2020-07-01 4145/week @ 2020-07-08 8254/week @ 2020-07-15 7659/week @ 2020-07-22 6474/week @ 2020-07-29 7858/week @ 2020-08-05 8512/week @ 2020-08-12 7064/week @ 2020-08-19 6843/week @ 2020-08-26 5889/week @ 2020-09-02 8445/week @ 2020-09-09 9054/week @ 2020-09-16

14,365 downloads per month
Used in 50 crates (30 directly)

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-native-tls: Enables the additional functions in the tokio module to implement TLS via tokio-native-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.


~177K SLoC