~/bend-docscommunity

ws.bend fails

raw source on the hub · import 0xd66ee682d4ce8c656782ca9e0e4634cb/ws.bend as Ws

WebSocket RFC 6455 full-duplex in Bend.

Import as: import ./ws.bend as WS (from lib) or import ../../lib/ws.bend as WS (from tests/io). Reuses Base, HTTP, SHA1, B64 and the byte effects in lib/tcp.bend (TCP.send_bytes/TCP.recv_bytes).

Scope: server and client, text and binary frames, fragmentation, ping/pong/close. No TLS (same limit as HTTP.fetch). Frames ride TCP.send_bytes/TCP.recv_bytes, byte-faithful on List<U32>; the pure codec stays full binary on List<U32>. See DESIGN below.

Discipline (user-land Bend has no Base carve-out): - every callee is defined ABOVE its caller; only self-recursion. - match scrutinees are params or pattern-bound vars, never computed. - helpers above drivers are leaves: they never call back down.

5 imports
import Base
import ./http.bend as HTTP
import ./sha1.bend as SHA1
import ./b64.bend as B64
import ./tcp.bend as TCP