ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
ws_client.h File Reference

The WebSocket Protocol (RFC 6455), client end: the opening handshake and the base framing protocol (PROTOCORE_ENABLE_WS_CLIENT). More...

#include "protocore_config.h"

Go to the source code of this file.

Detailed Description

The WebSocket Protocol (RFC 6455), client end: the opening handshake and the base framing protocol (PROTOCORE_ENABLE_WS_CLIENT).

RFC 6455 sec 3 gives the connection its four terms: /host/, /port/, /secure/ and the /resource name/ the request-line targets. The opening handshake rides on HTTP/1.1 - a GET request-line (RFC 9112 sec 3) carrying Host (RFC 9110 sec 7.2) and Upgrade (RFC 9110 sec 7.8), answered by 101 Switching Protocols (RFC 9110 sec 15.2.2). After that the connection carries frames, not messages, and every frame this end sends is masked (RFC 6455 sec 5.3).

Two halves behind one handle:

  • The codec (RFC 6455 sec 4 and sec 5) reads and writes octets in the caller's buffer and holds nothing, so it is unit-tested on the host (env:native_ws_client).
  • The transport drives one connection over the outbound TCP client, and wss:// over the shared persistent client TLS session. No heap; one connection at a time.

Only a message that fits PROTOCORE_WS_CLIENT_BUF_SIZE is delivered.

The module exports one symbol, WsClient. Everything in ws_client.c has internal linkage.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file ws_client.h.