Skip to main content

build_accept_response

Function build_accept_response 

Source
pub fn build_accept_response(
    key: &str,
    subprotocol: Option<&str>,
    extensions: Option<&str>,
) -> String
Expand description

Build the 101 Switching Protocols response for a validated handshake.

Sec-WebSocket-Accept is base64(SHA-1(key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")), computed by tungstenite::handshake::derive_accept_key — the same crate that then parses the frames, so there is exactly one implementation of the GUID concatenation in the tree.