#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

#5 in WebSocket

Download history 246/week @ 2019-04-25 208/week @ 2019-05-02 260/week @ 2019-05-09 230/week @ 2019-05-16 329/week @ 2019-05-23 356/week @ 2019-05-30 528/week @ 2019-06-06 462/week @ 2019-06-13 319/week @ 2019-06-20 501/week @ 2019-06-27 534/week @ 2019-07-04 502/week @ 2019-07-11 419/week @ 2019-07-18 674/week @ 2019-07-25 580/week @ 2019-08-01

1,888 downloads per month
Used in 29 crates (20 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

~4.5MB
~88K SLoC