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

#153 in WebSocket

Download history 90/week @ 2024-03-11 117/week @ 2024-03-18 103/week @ 2024-03-25 132/week @ 2024-04-01 109/week @ 2024-04-08 104/week @ 2024-04-15 47/week @ 2024-04-22 55/week @ 2024-04-29 41/week @ 2024-05-06 93/week @ 2024-05-13 65/week @ 2024-05-20 92/week @ 2024-05-27 82/week @ 2024-06-03 68/week @ 2024-06-10 97/week @ 2024-06-17 87/week @ 2024-06-24

350 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–20MB
~299K SLoC