Skip to content

One listen socket per resolved address: --host tailnet,lan and custom lists #6

Closed

Description

@Khang5687

Parent

Spec: #1 — Exposure as a set of listen interfaces (bind-hosts lane). Governing ADR: 0003.

What to build

The server opens one listen socket per resolved address, under both runtimes (Electron-as-Node for the desktop backend, Bun for bun dev). Nothing binds a wildcard unless the legacy 0.0.0.0 / :: form was explicitly requested. The temporary "first address + warning" behaviour from the tracer ticket is removed.

Runtime state lists every bound address plus resolver warnings; consumers that need one URL take the first. An explicit address absent from the machine is skipped with a warning naming it; the rest bind.

Preferred mechanism per ADR 0003: one HTTP server instance with one listener per address. Escape hatch, only if the HTTP server layer cannot be instantiated once per address: bind 0.0.0.0 and close any connection whose socket.localAddress is not in the resolved set — and update ADR 0003 in the same commit.

Demo: t3 serve --host tailnet,lan → both addresses accept; [::1] refused.

Acceptance criteria

  • Seam 1: {loopback, lan} with lan injected as the runner's real first non-internal IPv4 → both addresses accept; policy remote-reachable. If the runner has no such address the case skips with a message rather than faking one.
  • Seam 1: {loopback} → [::1] refused (no dual-stack wildcard).
  • Seam 1: an explicit address not in the injected map → skipped, warning names it, the remaining addresses accept.
  • Seam 1: legacy --host 0.0.0.0 → a single wildcard listener.
  • Every Seam 1 case passes identically whether the preferred mechanism or the escape hatch is used.
  • Both runtimes verified — the CI runtime automatically, the other at least manually; the PR states which.
  • Runtime state and startup output list all bound addresses; t3 pair picks the first non-loopback.
  • Graceful shutdown closes every listener; existing shutdown tests stay green.
  • If the escape hatch was taken, ADR 0003 records it in the same commit.

Blocked by

Activity

  1. added
    ready-for-agent
    on Sep 6, 2026
  2. Khang5687 commented on Sep 15, 2026

    @Khang5687
    OwnerAuthor

    Pinned from #5: while single-socket, --host tailnet binds the tailnet address and not loopback (interim recorded in ADR 0003). This ticket must restore ADR 0003's rule: loopback is bound alongside every selected interface, and the Seam 1 case {loopback, tailnet} (injected map) must show 127.0.0.1 accepting as well as the tailnet address. Remove the interim paragraph from ADR 0003 in the same PR.

  3. added a commit that references this issue on Sep 16, 2026
  4. Khang5687 commented on Sep 16, 2026

    @Khang5687
    OwnerAuthor

    Merged into fork-main via #13. Loopback bound alongside every selected interface; interim paragraph removed from ADR 0003.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions