#rfc6455 #lite


A fast, low-overhead WebSocket client

19 releases

0.5.2 Jul 24, 2022
0.5.0 Dec 24, 2020
0.4.0 Nov 4, 2020
0.3.5 Jun 28, 2020
0.2.1 Oct 26, 2018

#63 in WebSocket

Download history 332/week @ 2023-06-10 472/week @ 2023-06-17 499/week @ 2023-06-24 448/week @ 2023-07-01 439/week @ 2023-07-08 408/week @ 2023-07-15 440/week @ 2023-07-22 447/week @ 2023-07-29 490/week @ 2023-08-05 397/week @ 2023-08-12 339/week @ 2023-08-19 334/week @ 2023-08-26 247/week @ 2023-09-02 351/week @ 2023-09-09 438/week @ 2023-09-16 438/week @ 2023-09-23

1,490 downloads per month
Used in 4 crates (2 directly)

MIT license

1.5K SLoC



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


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.


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.


Documentation | Source

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

Additional command line tools


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.


~263K SLoC