#websocket #io #web

tokio-tungstenite

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

11 releases (7 breaking)

0.9.0 Aug 8, 2019
0.8.0 May 17, 2019
0.6.0 Aug 22, 2018
0.5.1 Jan 15, 2018
0.1.0 Mar 17, 2017

#4 in WebSocket

Download history 1944/week @ 2019-10-15 993/week @ 2019-10-22 1080/week @ 2019-10-29 1055/week @ 2019-11-05 1101/week @ 2019-11-12 1176/week @ 2019-11-19 1228/week @ 2019-11-26 1469/week @ 2019-12-03 2066/week @ 2019-12-10 1391/week @ 2019-12-17 492/week @ 2019-12-24 643/week @ 2019-12-31 1355/week @ 2020-01-07 1433/week @ 2020-01-14 530/week @ 2020-01-21

5,776 downloads per month
Used in 29 crates (19 directly)

MIT license

24KB
506 lines

tokio-tungstenite

Asynchronous WebSockets for Tokio stack.

MIT licensed Crates.io Build Status

Documentation

Usage

First, you need to add this in your Cargo.toml:

[dependencies]
tokio-tungstenite = "*"

Next, add this to your crate:

extern crate 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.

Dependencies

~3–4MB
~94K SLoC