Orbit Framework 2.0.0
A high-performance asynchronous C++20 HTTP server framework.
Loading...
Searching...
No Matches
orbit::http::websocket::Handshake Class Reference

Utility class for WebSocket handshakes. More...

#include <WebSocket.hpp>

Static Public Member Functions

static bool is_valid_client_key (std::string_view key)
 Checks that a Sec-WebSocket-Key is the base64 encoding of 16 bytes (RFC 6455 section 4.1): 22 base64 characters followed by "==".
 
static std::string generate_accept_key (const std::string &client_key)
 Generates the Sec-WebSocket-Accept key for the WebSocket handshake.
 

Detailed Description

Utility class for WebSocket handshakes.

Member Function Documentation

◆ generate_accept_key()

static std::string orbit::http::websocket::Handshake::generate_accept_key ( const std::string &  client_key)
inlinestatic

Generates the Sec-WebSocket-Accept key for the WebSocket handshake.

Parameters
client_keyThe base64-encoded Sec-WebSocket-Key from the client request.
Returns
The base64-encoded response key to send back to the client.

◆ is_valid_client_key()

static bool orbit::http::websocket::Handshake::is_valid_client_key ( std::string_view  key)
inlinestatic

Checks that a Sec-WebSocket-Key is the base64 encoding of 16 bytes (RFC 6455 section 4.1): 22 base64 characters followed by "==".


The documentation for this class was generated from the following file: