3 releases

Uses old Rust 2015

0.0.3 Nov 22, 2017
0.0.2 Oct 23, 2017
0.0.1 Sep 25, 2017

#278 in WebSocket

Download history 154/week @ 2024-03-12 199/week @ 2024-03-19 205/week @ 2024-03-26 248/week @ 2024-04-02 142/week @ 2024-04-09 197/week @ 2024-04-16 210/week @ 2024-04-23 180/week @ 2024-04-30 179/week @ 2024-05-07 179/week @ 2024-05-14 175/week @ 2024-05-21 176/week @ 2024-05-28 149/week @ 2024-06-04 128/week @ 2024-06-11 161/week @ 2024-06-18 155/week @ 2024-06-25

619 downloads per month

MIT license

205KB
4K SLoC

Rust-WebSocket is a WebSocket (RFC6455) library written in Rust.

Synchronous and Asynchronous

This crate has both async and sync implementations of websockets, you are free to choose which one you would like to use by switching on the async or sync features for this crate. By default both are switched on since they do not conflict with each other.

You'll find many modules with ::sync and ::async submodules that separate these behaviours. Since it get's tedious to add these on when appropriate a top-level convenience module called websocket::sync and websocket::async has been added that groups all the sync and async stuff, respectively.

Clients

To make a client use the ClientBuilder struct, this builder has methods for creating both synchronous and asynchronous clients.

Servers

WebSocket servers act similarly to the TcpListener, and listen for connections. See the Server struct documentation for more information. The bind() and bind_secure() functions will bind the server to the given SocketAddr.

Extending Rust-WebSocket

The ws module contains the traits and functions used by Rust-WebSocket at a lower level. Their usage is explained in the module documentation.

Dependencies

~4–14MB
~184K SLoC