From 8ca9a6c7047346273ba72e450c4c2a885260495f Mon Sep 17 00:00:00 2001 From: setkyar Date: Thu, 25 Dec 2025 22:09:22 +0800 Subject: [PATCH] fix(app): use window.location.origin for API URL fallback 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 #5844 Fixes #6063 --- packages/app/src/app.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/src/app.tsx b/packages/app/src/app.tsx index 11216643e5b..de8fcf7d124 100644 --- a/packages/app/src/app.tsx +++ b/packages/app/src/app.tsx @@ -38,7 +38,7 @@ const url = iife(() => { if (import.meta.env.DEV) return `http://${import.meta.env.VITE_OPENCODE_SERVER_HOST ?? "localhost"}:${import.meta.env.VITE_OPENCODE_SERVER_PORT ?? "4096"}` - return "http://localhost:4096" + return window.location.origin }) export function App() {