[−][src]Crate websockets
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 Frame
s.
License
This project is licensed under the MIT license.
Modules
secure | Types used to customize a secure WebSocket connection; used as arguments to
methods on the |
Structs
WebSocket | Manages the WebSocket connection; used to connect, send data, and receive data. |
WebSocketBuilder | A builder used to customize the WebSocket handshake. |
WebSocketReadHalf | The read half of a WebSocket connection, generated from |
WebSocketWriteHalf | The write half of a WebSocket connection, generated from |
Enums
Frame | Data which is sent and received through the WebSocket connection. |
WebSocketError | The possible error types from the WebSocket connection. |