ServerlessIRCd Docs

Docs home

ADR-009: Dual transport — wss (default) + irc+tls on :6697

Date: 2026-07-26 (Phase 7) Status: Accepted Supersedes: ADR-005 (wss-only transport in v1) Superseded by: —

Context

ADR-005 chose wss-only for v1. That decision rested on four points, all still accurate as facts about the serverless substrates:

  1. Both target platforms (CF Workers, AWS API Gateway WebSocket) support wss natively with zero additional infrastructure; neither can accept raw TCP from its request-response compute (Workers is request-response; API Gateway is WebSocket-only).
  2. wss is TLS-terminated at the edge (CF) or at API Gateway (AWS), so the Lambda/Worker never sees plaintext credentials.
  3. One IRC message per WebSocket text frame eliminates the need for a stateful byte-stream line buffer in the core (the parser already tolerates \r\n-joined frames for robustness).
  4. The serverless cost/ops story stays clean: no long-running origin, no TCP keepalive management, one codebase + two adapters.

What changed the decision is demand, not capability:

Decision

v1.x adopts a dual-transport model:

The pure reducer core and ConnectionActor are shared across both transports and both platforms. Only two things differ on the new path:

  1. The transport seam (TICKET-053): ConnectionActor accepts either a WsTextFrameTransport (one message per frame — current behavior) or a TcpByteStreamTransport (stateful \r\n framing across chunks with partial-line buffering). Parser → reducer → dispatch is unchanged.
  2. The entry-point adapter (TICKET-055 / TICKET-056): Spectrum+Container on CF, NLB+Lambda streaming on AWS.

mTLS (TICKET-054) is done at the edge on the wss path (CF API Shield mTLS / API Gateway custom-domain mTLS) and via the TLS handshake on the TCP path (Spectrum cert verification / NLB ACM cert + optional client-cert verification).

Consequences

Positive:

Negative:

References