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

#115 in WebSocket

Download history 536/week @ 2024-07-02 937/week @ 2024-07-09 561/week @ 2024-07-16 342/week @ 2024-07-23 542/week @ 2024-07-30 746/week @ 2024-08-06 472/week @ 2024-08-13 478/week @ 2024-08-20 536/week @ 2024-08-27 657/week @ 2024-09-03 579/week @ 2024-09-10 656/week @ 2024-09-17 1930/week @ 2024-09-24 1602/week @ 2024-10-01 928/week @ 2024-10-08 461/week @ 2024-10-15

4,986 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

~735KB
~12K SLoC