Version0.10.3Verifiednot yet verifiedLicenseBSD-3-Clause

sigil-websocket

WebSocket protocol library — client + server, with TLS

Report a bug or suggest a feature
Readme

sigil-websocket

A Sigil library for WebSocket client connections (RFC 6455). Supports both ws:// and wss:// (TLS) with cooperative non-blocking I/O.

Features

  • TLS support -- connect to ws:// and wss:// endpoints
  • Frame encoding/decoding -- text, binary, ping, pong, close
  • Client masking -- automatic frame masking per RFC 6455
  • Fragmentation -- transparent message reconstruction from continuation frames
  • Cooperative I/O -- non-blocking receive that yields to the scheduler

Usage

Add sigil-websocket as a dependency in your package.sgl:

(from-git url: "codeberg:sigil/sigil-websocket" package: "sigil-websocket")

Then connect and exchange messages:

(import (sigil websocket))

(define ws (ws-connect "wss://echo.websocket.org"))

(ws-send ws "Hello, WebSocket!")

(let loop ()
  (let ((msg (ws-receive ws)))
    (when (string? msg)
      (display msg)
      (loop))))

(ws-close ws)

Modules

ModuleDescription
(sigil websocket)Top-level re-exports
(sigil websocket frame)Frame encoding, decoding, masking
(sigil websocket connection)Handshake, send, receive, close

Dependencies

  • sigil-stdlib
  • sigil-socket
  • sigil-crypto

Building

sigil deps install
sigil build
sigil test

License

BSD-3-Clause

Clone

$ git clone https://codeberg.org/sigil/sigil-websocket

Releases

v0.10.3 — latest by version, released 14 Jul 2026

All releases — 6 tags in this repository.

Source

Browse the latest source

One page per file, and every line has a permalink.

Recent commitsAtom

The last 20 commits keep a page here. Everything older lives in the clone.