Crate tokio_tungstenite [] [src]

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 tokio support / tokio 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.

This crate primarily exports this ability through two extension traits, ClientHandshakeExt and ServerHandshakeExt. These traits augment the functionality provided by the tungestenite crate, on which this crate is built. Configuration is done through tungestenite crate as well.

Structs

AcceptAsync

Future returned from accept_async() which will resolve once the connection handshake has finished.

ConnectAsync

Future returned from connect_async() which will resolve once the connection handshake has finished.

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.

client_async

Create a handshake provided stream and assuming the provided request.