Skip to content

fix: allow WebSocket connections from non-loopback IPs in --insecure mode#18633

Merged
alt-glitch merged 1 commit into
mainfrom
fix/dashboard-ws-loopback-insecure
May 2, 2026
Merged

fix: allow WebSocket connections from non-loopback IPs in --insecure mode#18633
alt-glitch merged 1 commit into
mainfrom
fix/dashboard-ws-loopback-insecure

Conversation

@alt-glitch

Copy link
Copy Markdown
Collaborator

Problem

When running hermes dashboard --host 0.0.0.0 --insecure behind a reverse proxy (e.g. Tailscale Serve), the dashboard page loads but WebSocket connections to /api/pty, /api/ws, /api/pub, and /api/events are rejected with close code 4403. This causes the "events feed disconnected" error in the UI — tool calls don't appear in the sidebar.

The --insecure flag bypasses the Host header middleware but the WebSocket endpoints have an independent hardcoded loopback-only check on the client IP that doesn't respect the bind mode.

Fix

  • Extract the repeated 4-line loopback check into _ws_client_is_allowed(ws) helper (DRY)
  • When bound to 0.0.0.0/:: (public bind / --insecure), skip the client IP restriction
  • Session token HMAC auth is still enforced on every WS endpoint regardless of bind mode

Testing

  • tests/hermes_cli/test_web_server_host_header.py — 8/8 pass
  • tests/hermes_cli/ WS/PTY tests — 306 passed, 1 skipped

…mode

When the dashboard is bound to 0.0.0.0 with --insecure (e.g. behind
Tailscale Serve), WebSocket endpoints (/api/pty, /api/ws, /api/pub,
/api/events) rejected connections from non-loopback client IPs with
code 4403 — causing 'events feed disconnected' in the UI.

Extract the repeated loopback check into _ws_client_is_allowed() which
respects the public bind flag. Session token auth still guards all
endpoints regardless of bind mode.
@alt-glitch alt-glitch merged commit 585d677 into main May 2, 2026
10 of 11 checks passed
@alt-glitch alt-glitch deleted the fix/dashboard-ws-loopback-insecure branch May 2, 2026 02:47
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard labels May 2, 2026
nickdlkk pushed a commit to nickdlkk/hermes-agent that referenced this pull request May 11, 2026
…mode (NousResearch#18633)

When the dashboard is bound to 0.0.0.0 with --insecure (e.g. behind
Tailscale Serve), WebSocket endpoints (/api/pty, /api/ws, /api/pub,
/api/events) rejected connections from non-loopback client IPs with
code 4403 — causing 'events feed disconnected' in the UI.

Extract the repeated loopback check into _ws_client_is_allowed() which
respects the public bind flag. Session token auth still guards all
endpoints regardless of bind mode.
jsboige pushed a commit to jsboige/hermes-agent that referenced this pull request May 14, 2026
…mode (NousResearch#18633)

When the dashboard is bound to 0.0.0.0 with --insecure (e.g. behind
Tailscale Serve), WebSocket endpoints (/api/pty, /api/ws, /api/pub,
/api/events) rejected connections from non-loopback client IPs with
code 4403 — causing 'events feed disconnected' in the UI.

Extract the repeated loopback check into _ws_client_is_allowed() which
respects the public bind flag. Session token auth still guards all
endpoints regardless of bind mode.
dannyJ848 pushed a commit to dannyJ848/hermes-agent that referenced this pull request May 17, 2026
…mode (NousResearch#18633)

When the dashboard is bound to 0.0.0.0 with --insecure (e.g. behind
Tailscale Serve), WebSocket endpoints (/api/pty, /api/ws, /api/pub,
/api/events) rejected connections from non-loopback client IPs with
code 4403 — causing 'events feed disconnected' in the UI.

Extract the repeated loopback check into _ws_client_is_allowed() which
respects the public bind flag. Session token auth still guards all
endpoints regardless of bind mode.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…mode (NousResearch#18633)

When the dashboard is bound to 0.0.0.0 with --insecure (e.g. behind
Tailscale Serve), WebSocket endpoints (/api/pty, /api/ws, /api/pub,
/api/events) rejected connections from non-loopback client IPs with
code 4403 — causing 'events feed disconnected' in the UI.

Extract the repeated loopback check into _ws_client_is_allowed() which
respects the public bind flag. Session token auth still guards all
endpoints regardless of bind mode.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…mode (NousResearch#18633)

When the dashboard is bound to 0.0.0.0 with --insecure (e.g. behind
Tailscale Serve), WebSocket endpoints (/api/pty, /api/ws, /api/pub,
/api/events) rejected connections from non-loopback client IPs with
code 4403 — causing 'events feed disconnected' in the UI.

Extract the repeated loopback check into _ws_client_is_allowed() which
respects the public bind flag. Session token auth still guards all
endpoints regardless of bind mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant