Function tungstenite::server::accept [] [src]

pub fn accept<Stream: Read + Write>(
    stream: Stream
) -> Result<WebSocket<Stream>, HandshakeError<Stream, ServerHandshake>>

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 or openssl::ssl::SslStream for the stream here. Any Read + Write streams are supported, including those from Mio and others.