3 releases

Uses old Rust 2015

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

#258 in WebSocket

Download history 100/week @ 2023-12-06 139/week @ 2023-12-13 154/week @ 2023-12-20 58/week @ 2023-12-27 83/week @ 2024-01-03 146/week @ 2024-01-10 122/week @ 2024-01-17 97/week @ 2024-01-24 54/week @ 2024-01-31 133/week @ 2024-02-07 150/week @ 2024-02-14 168/week @ 2024-02-21 165/week @ 2024-02-28 181/week @ 2024-03-06 163/week @ 2024-03-13 171/week @ 2024-03-20

715 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

~5–15MB
~202K SLoC