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

#161 in WebSocket

Download history 277/week @ 2023-12-11 284/week @ 2023-12-18 52/week @ 2023-12-25 119/week @ 2024-01-01 174/week @ 2024-01-08 240/week @ 2024-01-15 223/week @ 2024-01-22 121/week @ 2024-01-29 170/week @ 2024-02-05 90/week @ 2024-02-12 164/week @ 2024-02-19 136/week @ 2024-02-26 86/week @ 2024-03-04 90/week @ 2024-03-11 117/week @ 2024-03-18 116/week @ 2024-03-25

415 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
~326K SLoC