diff options
| author | lif <[email protected]> | 2025-12-22 19:45:08 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-22 05:45:08 -0600 |
| commit | d04a72a4ad6af0bfe75bbff36004d28adca179b2 (patch) | |
| tree | 16a49b202cd0ddd0ddef4150f821bee0b57602c5 /packages/desktop/src | |
| parent | 5fd873a35a19de2f9e89c420158d5697746d2983 (diff) | |
| download | opencode-d04a72a4ad6af0bfe75bbff36004d28adca179b2.tar.gz opencode-d04a72a4ad6af0bfe75bbff36004d28adca179b2.zip | |
fix: use current page port instead of hardcoded 4096 (#5949)
Co-authored-by: Claude <[email protected]>
Diffstat (limited to 'packages/desktop/src')
| -rw-r--r-- | packages/desktop/src/app.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/desktop/src/app.tsx b/packages/desktop/src/app.tsx index 2ed529bbc..4f4b6f32c 100644 --- a/packages/desktop/src/app.tsx +++ b/packages/desktop/src/app.tsx @@ -29,13 +29,15 @@ declare global { } const host = import.meta.env.VITE_OPENCODE_SERVER_HOST ?? "127.0.0.1" -const port = window.__OPENCODE__?.port ?? import.meta.env.VITE_OPENCODE_SERVER_PORT ?? "4096" +const port = window.__OPENCODE__?.port ?? import.meta.env.VITE_OPENCODE_SERVER_PORT ?? location.port ?? "4096" const url = new URLSearchParams(document.location.search).get("url") || - (location.hostname.includes("opencode.ai") || location.hostname.includes("localhost") + (location.hostname.includes("opencode.ai") ? `http://${host}:${port}` - : "/") + : location.hostname.includes("localhost") || location.hostname === "127.0.0.1" + ? `${location.protocol}//${location.host}` + : "/") export function App() { return ( |
