9 releases

0.3.0 Jul 29, 2021
0.2.0 Dec 3, 2020
0.1.6 Sep 23, 2020
0.1.3 Aug 28, 2020

#173 in WebSocket

Download history 48/week @ 2024-07-21 120/week @ 2024-07-28 96/week @ 2024-08-04 53/week @ 2024-08-11 39/week @ 2024-08-18 94/week @ 2024-08-25 101/week @ 2024-09-01 45/week @ 2024-09-08 93/week @ 2024-09-15 49/week @ 2024-09-22 91/week @ 2024-09-29 23/week @ 2024-10-06 40/week @ 2024-10-13 67/week @ 2024-10-20 65/week @ 2024-10-27 32/week @ 2024-11-03

205 downloads per month
Used in 3 crates

MIT license

78KB
1K SLoC

WebSockets

github crates.io docs.rs

A WebSocket client implementation.

use websockets::WebSocket;

let mut ws = WebSocket::connect("wss://echo.websocket.org/").await?;
ws.send_text("foo".to_string()).await?;
ws.receive().await?;
ws.close(None).await?;

Features

  • Simple API
  • Async/await (tokio runtime)
  • TLS support (automatically detected)

Usage

The WebSocket type manages the WebSocket connection. Use it to connect, send, and receive data. Data is sent and received through Frames.

License

This project is licensed under the MIT license.

Credits

  • Thank you to @thsioutas for adding support for custom TLS configuration
  • Thank you to @secana for making the write half Send

Dependencies

~10–22MB
~317K SLoC