Skip to content

fix(server): open the IPv4 loopback the server binds (Windows IPv6 fix)#15

Open
urbanlama wants to merge 1 commit into
masterfrom
fix/server-ipv4-loopback-bind
Open

fix(server): open the IPv4 loopback the server binds (Windows IPv6 fix)#15
urbanlama wants to merge 1 commit into
masterfrom
fix/server-ipv4-loopback-bind

Conversation

@urbanlama
Copy link
Copy Markdown
Collaborator

@

Problem

The dashboard server binds 127.0.0.1 (IPv4 loopback only, by design — /api/data is unauthenticated) but opened/reported http://localhost:<port>. On Windows localhost resolves to ::1 (IPv6) first, where nothing listens, so the browser hangs in SYN_SENT and the dashboard "almost never" opens when launched from the widget.

Fix

  • Single-source the loopback host (DASHBOARD_HOST) for both the bind hostname and the opened URL, so they can never drift again.
  • Expose the resolved url on ServerHandle so callers stop reconstructing it from a host string (that reconstruction was the bug).
  • Add a regression test asserting the reported URL uses the 127.0.0.1 literal and is actually reachable (HTTP 200).

Test plan

  • npm run test — new src/server.test.ts guards the regression
  • CI green (lint / test / build across Linux/macOS/Windows)

🤖 Generated with Claude Code
@

The dashboard server binds 127.0.0.1 (IPv4 loopback only, by design) but
opened/reported http://localhost:<port>. On Windows `localhost` resolves to
::1 (IPv6) first, where nothing listens, so the browser hangs in SYN_SENT
and the dashboard "almost never" opens when launched from the widget.

Single-source the loopback host (DASHBOARD_HOST) for both the bind hostname
and the opened URL so they can never drift again, and expose the resolved
URL on ServerHandle so callers stop reconstructing it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants