src/handshake.c file

Handshake routines.

Contents

Functions

auto get_handshake_accept(char* wsKey, unsigned char** dest) -> int
Gets the field Sec-WebSocket-Accept on response, by an previously informed key.
auto get_handshake_response(char* hsrequest, char** hsresponse) -> int
Gets the complete response to accomplish a succesfully handshake.

Function documentation

int get_handshake_accept(char* wsKey, unsigned char** dest)

Gets the field Sec-WebSocket-Accept on response, by an previously informed key.

Parameters
wsKey Sec-WebSocket-Key
dest source to be stored the value.
Returns Returns 0 if success and a negative number otherwise.

int get_handshake_response(char* hsrequest, char** hsresponse)

Gets the complete response to accomplish a succesfully handshake.

Parameters
hsrequest Client request.
hsresponse Server response.
Returns Returns 0 if success and a negative number otherwise.