Skip to content

WebSocket Reference

Qriist edited this page Sep 17, 2026 · 2 revisions

The WebSocket interface provides framed, protocol-level messaging over an established TCP/TLS connection. The easy_handle must be converted to WebSocket mode before any send or receive operations can occur.

Official libcurl Reference

Setup

Method Description libcurl Reference
WebSocketConvert(easy_handle?) Upgrades the handle to WebSocket mode, performing the handshake and configuring internal framing. curl_ws_send
SetWebSocketFrameSize(frame_size := 10 * 1024, easy_handle?) Configures the outgoing frame size limit (default 10 KB). curl_ws_send

Transfer

Method Description libcurl Reference
WebSocketSend(content, flagArr := ["TEXT"], easy_handle?) Transmits a framed WebSocket message. Accepts String, Integer, Object, Array, Map, and Buffer. curl_ws_send
WebSocketReceive(easy_handle?) Reads incoming WebSocket frames. Internally handles the CURL_WAITING_READY state. curl_ws_recv

Where to Go Next

Clone this wiki locally