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

#117 in WebSocket

Download history 163/week @ 2023-10-31 404/week @ 2023-11-07 291/week @ 2023-11-14 458/week @ 2023-11-21 443/week @ 2023-11-28 410/week @ 2023-12-05 237/week @ 2023-12-12 293/week @ 2023-12-19 105/week @ 2023-12-26 171/week @ 2024-01-02 256/week @ 2024-01-09 214/week @ 2024-01-16 247/week @ 2024-01-23 172/week @ 2024-01-30 193/week @ 2024-02-06 185/week @ 2024-02-13

829 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

~8–22MB
~327K SLoC