Adam 2 месяцев назад
Родитель
Сommit
de415be4f6
2 измененных файлов с 5 добавлено и 5 удалено
  1. 2 2
      packages/opencode/src/cli/cmd/web.ts
  2. 3 3
      packages/opencode/src/server/server.ts

+ 2 - 2
packages/opencode/src/cli/cmd/web.ts

@@ -55,7 +55,7 @@ export const WebCommand = cmd({
 
     if (hostname === "0.0.0.0") {
       // Show localhost for local access
-      const localhostUrl = `http://localhost:${server.port}`
+      const localhostUrl = `http://localhost:${server.port}/web`
       UI.println(UI.Style.TEXT_INFO_BOLD + "  Local access:      ", UI.Style.TEXT_NORMAL, localhostUrl)
 
       // Show network IPs for remote access
@@ -73,7 +73,7 @@ export const WebCommand = cmd({
       // Open localhost in browser
       open(localhostUrl.toString()).catch(() => {})
     } else {
-      const displayUrl = server.url.toString()
+      const displayUrl = server.url.toString() + "web"
       UI.println(UI.Style.TEXT_INFO_BOLD + "  Web interface:    ", UI.Style.TEXT_NORMAL, displayUrl)
       open(displayUrl).catch(() => {})
     }

+ 3 - 3
packages/opencode/src/server/server.ts

@@ -2371,11 +2371,11 @@ export namespace Server {
           })
         },
       )
-      .all("/*", async (c) => {
-        return proxy(`https://desktop.dev.opencode.ai${c.req.path}`, {
+      .all("/web/*", async (c) => {
+        return proxy(`https://desktop.opencode.ai${c.req.path.replace(/^\/web/, "")}?=url=/web`, {
           ...c.req,
           headers: {
-            host: "desktop.dev.opencode.ai",
+            host: "desktop.opencode.ai",
           },
         })
       }),