pub fn validate_upgrade_request(
method: &str,
headers: &[(String, Vec<u8>)],
) -> Result<String, WebSocketError>Expand description
Validate that an HTTP request is a valid WebSocket upgrade request.
Checks (RFC 6455 ยง4.2.1):
- Method is GET
Upgrade: websocketheader present (case-insensitive)Connection: upgradeheader present (case-insensitive)Sec-WebSocket-Keyheader present and non-emptySec-WebSocket-Version: 13header present
Returns the Sec-WebSocket-Key value on success.