Skip to main content

build_accept_response

Function build_accept_response 

Source
pub fn build_accept_response(
    client_key: &str,
    subprotocol: Option<&str>,
) -> Result<Vec<u8>, WebSocketError>
Expand description

Build the HTTP 101 Switching Protocols response bytes for a WebSocket upgrade.

If subprotocol is provided, includes Sec-WebSocket-Protocol in the response.