Skip to main content

handshake_response

Function handshake_response 

Source
pub fn handshake_response(req: &RequestHead) -> ResponseBuilder
Expand description

Creates a WebSocket opening-handshake response.

The returned response builder has status 101 Switching Protocols and the required upgrade and challenge-response headers.

ยงPanics

Panics if req does not contain a Sec-WebSocket-Key header or the key exceeds the length accepted by hash_key. Use handshake when the request has not already been validated.