Skip to main content

Module ws

Module ws 

Source

Structs§

WsBuf
Buffered non-blocking WebSocket frame reader.
WsFrame
A decoded WebSocket frame.

Functions§

do_handshake
Complete the WebSocket handshake (write 101 response).
is_upgrade
Check if an HTTP request is a WebSocket upgrade.
read_frame
Read a single WebSocket frame. Handles masking.
run_ws_loop
Handle a WebSocket connection: read frames, respond to control frames, dispatch text messages.
write_close_frame
Write a close frame.
write_pong_frame
Write a pong frame.
write_text_frame
Write a text frame (server→client, unmasked).