Skip to content

feat(http): support explicit bind hosts for web access#279

Open
ben-vargas wants to merge 2 commits intocoollabsio:mainfrom
ben-vargas:upstream-bind-host-pr
Open

feat(http): support explicit bind hosts for web access#279
ben-vargas wants to merge 2 commits intocoollabsio:mainfrom
ben-vargas:upstream-bind-host-pr

Conversation

@ben-vargas
Copy link
Copy Markdown

Problem

Jean's web access currently behaves like a two-mode bind:

  • loopback only
  • all interfaces

That makes private remote access setups awkward. For example, binding only to a Tailscale IP is not possible today.

Change

This PR adds explicit bind-host support for web access.

  • Headless --host now binds to the literal requested address
  • Desktop Web Access supports a specific bind host instead of only a localhost toggle
  • Existing http_server_localhost_only behavior is preserved as a fallback for compatibility

This makes setups like 100.x.y.z Tailscale-only binding possible in both headless and desktop usage.

Validation

Tested with:

  • bun run typecheck
  • targeted Rust tests for bind-host parsing and normalization
  • desktop app verification via bun run tauri:dev

Runtime verification:

  • confirmed Jean listened on a specific Tailscale IP instead of 0.0.0.0
  • confirmed access from another device over the tailnet

If this isn't a direction you want to support upstream, feel free to close the PR. It's already working well in my fork, so there's no pressure to merge it.

Treat the HTTP server host as a real bind target instead of collapsing it to a localhost-vs-all-interfaces boolean. This makes headless runs honor explicit addresses such as a Tailscale IP while preserving the existing desktop localhost/all-interfaces preference behavior.

The server now parses and binds the requested host directly, reports the actual bind host in server status, logs the effective bind target, and formats URLs correctly for IPv4/IPv6. The CLI help and README were updated to describe the new behavior, and targeted Rust tests were added for host parsing and URL formatting.
Add a persisted http_server_bind_host preference for the desktop app and fall back to the legacy http_server_localhost_only boolean when no explicit host is configured. This keeps existing settings files compatible while allowing the GUI app to bind to a specific address such as a Tailscale IP.

The Web Access pane now exposes a bind-address field instead of the old localhost-only toggle, validates localhost/IP input, restarts the server when the bind address changes, and only shows URL rows that are actually reachable for the active bind target. Preference fixtures and Rust unit tests were updated to cover the new fallback behavior.
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.

1 participant