#websocket #codec

websocket-codec

A Tokio codec for the websocket protocol

12 unstable releases (3 breaking)

0.4.0 Nov 4, 2020
0.3.5 Jun 28, 2020
0.3.4 Apr 30, 2020
0.3.3 Mar 1, 2020
0.1.1 Apr 15, 2019

#8 in WebSocket

Download history 88/week @ 2020-08-13 75/week @ 2020-08-20 73/week @ 2020-08-27 82/week @ 2020-09-03 56/week @ 2020-09-10 56/week @ 2020-09-17 36/week @ 2020-09-24 41/week @ 2020-10-01 54/week @ 2020-10-08 39/week @ 2020-10-15 45/week @ 2020-10-22 59/week @ 2020-10-29 281/week @ 2020-11-05 64/week @ 2020-11-12 51/week @ 2020-11-19 51/week @ 2020-11-26

248 downloads per month
Used in 7 crates (4 directly)

MIT license

40KB
927 lines

websocket-lite

CI

This repo contains three crates:

  • websocket-lite, a fast, low-overhead WebSocket client
  • websocket-codec, a Tokio codec implementation of the WebSocket protocol
  • hyper-websocket-lite, bindings between a hyper server and websocket-codec

websocket-lite

Documentation | Source

This crate is optimised for receiving a high volume of messages over a long period. A key feature is that it makes no memory allocations once the connection is set up and the initial messages have been sent and received; it reuses a single pair of buffers, which are sized for the longest message seen so far.

You can use this crate in both asynchronous (futures-based) and synchronous code. native_tls provides the TLS functionality for wss://... servers.

This crate is fully conformant with the fuzzingserver module in the Autobahn test suite.

websocket-codec

Documentation | Source

This is a standalone crate that does not do any I/O directly. For a full WebSocket client, see the websocket-lite crate.

hyper-websocket-lite

Documentation | Source

Provides the server_upgrade function, which bridges a client's HTTP Upgrade request to the WebSocket protocol.

Additional command line tools

async/await

Version 0.3.2 and above use std futures and the async and await keywords. They are based on tokio 0.2 and futures 0.3 and the earliest supported compiler is 1.39.

Version 0.2.4 is the release prior to async/await. It is based on tokio 0.1 and futures 0.1.

Dependencies

~3MB
~49K SLoC