#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 529/week @ 2019-07-26 638/week @ 2019-08-02 639/week @ 2019-08-09 671/week @ 2019-08-16 692/week @ 2019-08-23 908/week @ 2019-08-30 870/week @ 2019-09-06 1054/week @ 2019-09-13 1169/week @ 2019-09-20 1330/week @ 2019-09-27 1659/week @ 2019-10-04 1745/week @ 2019-10-11 1331/week @ 2019-10-18 1055/week @ 2019-10-25 927/week @ 2019-11-01

1,888 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

~4MB
~90K SLoC