Available on crate feature
ws only.Expand description
WebSocket support based on tungstenite.
This library is an implementation of WebSocket handshakes and streams for compio. It is based on the tungstenite crate which implements all required WebSocket protocol logic. This crate brings compio support / compio integration to it.
Each WebSocket stream implements message reading and writing.
Modules§
- tungstenite
- Lightweight, flexible WebSockets for Rust.
Structs§
- Config
- Configuration for compio-ws.
- WebSocket
Stream - A WebSocket stream that works with compio.
Functions§
- accept_
async - Accepts a new WebSocket connection with the provided stream.
- accept_
async_ with_ config - Similar to
accept_async()but user can specify aConfig. - accept_
hdr_ async - Accepts a new WebSocket connection with the provided stream.
- accept_
hdr_ with_ config_ async - Similar to
accept_hdr_async()but user can specify aConfig. - client_
async - Creates a WebSocket handshake from a request and a stream.
- client_
async_ tls - Creates a WebSocket handshake from a request and a stream, upgrading the stream to TLS if required.
- client_
async_ tls_ with_ config - Similar to
client_async_tls()but the one can specify a websocket configuration, and an optional connector. - client_
async_ with_ config - Similar to
client_async()but user can specify aConfig. - connect_
async - Connect to a given URL.
- connect_
async_ tls_ with_ config - Similar to
connect_async(), but user can specify aConfigand an optionalTlsConnector. - connect_
async_ with_ config - Similar to
connect_async(), but user can specify aConfig.