ServerlessIRCd Docs

Docs home

ADR-005: wss-only transport in v1 (no raw TCP)

Date: 2025-01-15 (Phase 1) Status: Superseded by ADR-009 (Phase 7 — TICKET-052) Supersedes: —

Context

IRC is traditionally spoken over raw TCP (port 6667 plaintext, 6697 TLS). WebSocket Secure (wss) is a framing layer over TLS that adds an HTTP upgrade handshake. Serverless compute platforms have fundamentally different support for these two transports:

The v1 goal is a clean serverless story: one codebase, two adapters, zero stateful origin servers. Raw TCP on either platform requires additional, non-serverless infrastructure (a long-running container on CF; NLB + Lambda streaming on AWS).

Additionally, wss carries one IRC message per WebSocket text frame, which simplifies framing: the server does not need to implement a stateful byte-stream line buffer. The parser still tolerates \r\n-joined frames (multiple messages in one text frame) for robustness, but the common case is one-message-per-frame.

Decision

v1 ships wss-only. No plaintext TCP listener, no irc:// scheme, no port 6667/6697. Clients connect via wss://server.tld/ and speak IRC inside WebSocket text frames.

Rationale:

  1. Both target platforms support wss natively without additional infrastructure.
  2. wss is TLS-terminated at the edge (CF) or at API Gateway (AWS) — the Lambda/Worker never sees plaintext credentials.
  3. One-message-per-frame eliminates the need for a TCP-style line-framing buffer in the core (though the parser tolerates joined frames).
  4. The serverless cost/ops model is clean: no long-running origin, no TCP keepalive management.

The ConnectionActor transport seam accepts WebSocket text frames directly. A Transport interface is not abstracted in v1 — the actor's receiveTextFrame(text) is the only entry point.

Consequences

Positive:

Negative:

Superseded: Phase 7 (TICKET-052) reverses this decision for v1.x: a dual-transport model (wss stays the default; irc+tls on :6697 is added via Cloudflare Spectrum + Container origin, and AWS NLB + Lambda streaming). This ADR documents the original v1 rationale; the superseding ADR covers the reversal and per-platform TCP+TLS mapping.

References