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

#56 in WebSocket

Download history 130/week @ 2022-03-14 101/week @ 2022-03-21 137/week @ 2022-03-28 32/week @ 2022-04-04 121/week @ 2022-04-11 87/week @ 2022-04-18 188/week @ 2022-04-25 209/week @ 2022-05-02 101/week @ 2022-05-09 274/week @ 2022-05-16 144/week @ 2022-05-23 154/week @ 2022-05-30 193/week @ 2022-06-06 92/week @ 2022-06-13 86/week @ 2022-06-20 102/week @ 2022-06-27

495 downloads per month
Used in qusb2snes-client

MIT license

77KB
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

~7–14MB
~288K SLoC