[−][src]Crate async_tungstenite
Async WebSocket usage.
This library is an implementation of WebSocket handshakes and streams. It is based on the crate which implements all required WebSocket protocol logic. So this crate basically just brings async_std support / async_std integration to it.
Each WebSocket stream implements the required Stream
and Sink
traits,
so the socket is just a stream of messages coming in and going out.
Re-exports
pub use tungstenite; |
Modules
stream | Convenience wrapper for streams to switch between plain TCP and TLS at runtime. |
Structs
WebSocketStream | A wrapper around an underlying raw stream which implements the WebSocket protocol. |
Functions
accept_async | Accepts a new WebSocket connection with the provided stream. |
accept_async_with_config | The same as |
accept_hdr_async | Accepts a new WebSocket connection with the provided stream. |
accept_hdr_async_with_config | The same as |
client_async | Creates a WebSocket handshake from a request and a stream.
For convenience, the user may call this with a url string, a URL,
or a |
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 | Creates a WebSocket handshake from a request and a stream, upgrading the stream to TLS if required and using the given WebSocket configuration. |
client_async_tls_with_connector | Creates a WebSocket handshake from a request and a stream, upgrading the stream to TLS if required and using the given connector. |
client_async_tls_with_connector_and_config | Creates a WebSocket handshake from a request and a stream, upgrading the stream to TLS if required and using the given connector and WebSocket configuration. |
client_async_with_config | The same as |
connect_async | Connect to a given URL. |
connect_async_with_config | Connect to a given URL with a given WebSocket configuration. |
connect_async_with_tls_connector | Connect to a given URL using the provided TLS connector. |
connect_async_with_tls_connector_and_config | Connect to a given URL using the provided TLS connector. |
Type Definitions
MaybeTlsStream | A stream that might be protected with TLS. |