[][src]Function actix_send_websocket::handshake_with_protocols

pub fn handshake_with_protocols(
    req: &HttpRequest,
    protocols: &[&str]
) -> Result<ResponseBuilder, HandshakeError>

Prepare WebSocket handshake response.

This function returns handshake HttpResponse, ready to send to peer. It does not perform any IO.

protocols is a sequence of known protocols. On successful handshake, the returned response headers contain the first protocol in this list which the server also knows.