Function tungstenite::accept

source ·
pub fn accept<S: Read + Write>(
    stream: S
) -> Result<WebSocket<S>, HandshakeError<ServerHandshake<S, NoCallback>>>
Expand description

Accept the given Stream as a WebSocket.

This function starts a server WebSocket handshake over the given stream. If you want TLS support, use native_tls::TlsStream, rustls::Stream or openssl::ssl::SslStream for the stream here. Any Read + Write streams are supported, including those from Mio and others.