Module ws

Module ws 

Source
Expand description

Websocket utilities

Enums§

UpgradeError
Websocket upgrade errors

Constants§

MAX_BASE64_KEY_LEN
MAX_BASE64_KEY_RESPONSE_LEN
NONCE_LEN
UPGRADE_REQUEST_HEADERS_LEN
UPGRADE_RESPONSE_HEADERS_LEN

Functions§

is_upgrade_accepted
Check if the response is a Websocket upgrade response and if the upgrade was accepted
is_upgrade_request
Check if the request is a Websocket upgrade request
sec_key_response
Compute the response for a given Sec-WebSocket-Key
upgrade_request_headers
Return ready-to-use WS upgrade request headers
upgrade_response_headers
Return ready-to-use WS upgrade response headers