16 releases (6 stable)

1.2.1 Sep 30, 2024
1.0.3 Jul 25, 2024
0.4.2 May 9, 2024
0.4.1 Aug 8, 2023
0.1.1 Nov 23, 2021

#172 in WebSocket

Download history 487/week @ 2024-08-17 532/week @ 2024-08-24 621/week @ 2024-08-31 539/week @ 2024-09-07 703/week @ 2024-09-14 1203/week @ 2024-09-21 2054/week @ 2024-09-28 1078/week @ 2024-10-05 677/week @ 2024-10-12 481/week @ 2024-10-19 614/week @ 2024-10-26 952/week @ 2024-11-02 870/week @ 2024-11-09 638/week @ 2024-11-16 624/week @ 2024-11-23 853/week @ 2024-11-30

3,154 downloads per month
Used in 13 crates (3 directly)

Apache-2.0

15KB
231 lines




Ratchet Extensions

Ratchet is a fast, robust, lightweight and fully asynchronous implementation of RFC6455 (The WebSocket protocol). Complete with an optional implementation of RFC7692 (Compression Extensions For WebSocket).

This crate is used for implementing WebSocket extensions. See the documentation for details.


lib.rs:

A library for writing extensions for Ratchet.

Implementations:

ratchet_deflate

Usage

Implementing an extension requires two traits to be implemented: [ExtensionProvider] for negotiating the extension during the WebSocket handshake, and [Extension] (along with its bounds) for using the extension during the session.

Splitting an extension

If a WebSocket is to be split into its sending and receiving halves then the extension must implement the SplittableExtension trait and if it is to be reunited then it must implement the ReunitableExtension. This allows more fine-grained control over the BiLock within the receiver.

Dependencies

~740KB
~13K SLoC