Skip to content

Conversation

@setkyar
Copy link

@setkyar setkyar commented Dec 25, 2025

Summary

  • Fix web UI failing when accessed via non-localhost addresses (Tailscale IP, LAN IP, custom hostname)
  • Change API URL fallback from hardcoded http://localhost:4096 to window.location.origin

Problem

When running opencode serve --hostname=0.0.0.0 and accessing via a network IP (e.g., http://192.168.1.100:4096), the frontend was hardcoded to make API requests to http://localhost:4096, which doesn't exist on the remote machine.

Solution

Use window.location.origin as the fallback, which dynamically resolves to the actual server address.

Fixes #5844
Fixes #6063

When accessing the web UI via non-localhost addresses (e.g., Tailscale IP,
LAN IP), the frontend was hardcoded to use http://localhost:4096 as the
API URL, causing all API requests to fail.

This changes the fallback to use window.location.origin, which dynamically
uses the actual server address from which the page was loaded.

Fixes sst#5844
Fixes sst#6063
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.

Serve on custom port / remote server broken Bug: Web terminal fails when accessing via network IP instead of localhost

1 participant