|
STTNet
|
Responsible for string operations related to the WebSocket protocol. More...
#include <sttnet_English.h>
Static Public Member Functions | |
| static std::string & | transfer_websocket_key (std::string &str) |
| Generate the Sec-WebSocket-Accept field value in the WebSocket handshake response. More... | |
Responsible for string operations related to the WebSocket protocol.
|
static |
Generate the Sec-WebSocket-Accept field value in the WebSocket handshake response.
Based on the Sec-WebSocket-Key provided by the client, this function concatenates the WebSocket-specified magic GUID, then performs SHA-1 hashing and Base64 encoding to obtain the accept string required for the handshake response.
| str | The input is the Sec-WebSocket-Key provided by the client, which will be modified in place to the result string (Sec-WebSocket-Accept). |
1.8.5