outgoing connection requests while using web mode #9310

Open
opened 2026-02-16 18:12:09 -05:00 by yindo · 2 comments
Owner

Originally created by @jokedoke on GitHub (Feb 14, 2026).

Originally assigned to: @adamdotdevin on GitHub.

Question

when you start opencode web mode, opencode tries to communicate models.dev and app.opencode.ai at startup. models.dev is ok but I dont understand app.opencode.ai.opencode web mode wont run without communicating app.opencode.ai.
tcpdump output

listening on enp0s31f6, link-type EN10MB (Ethernet), snapshot length 262144 bytes
06:48:20.956599 IP 192.168.68.109.34244 > 8.8.8.8.domain: 24476+ [1au] A? app.opencode.ai. (44)
06:48:20.956611 IP 192.168.68.109.34244 > 8.8.8.8.domain: 5023+ [1au] AAAA? app.opencode.ai. (44)

If I block dns queries to resolve app.opencode.ai. web mode application fails to open. here is the what browser shows when you enter opencode UI.
{"name":"UnknownError","data":{"message":"Error: Unable to connect. Is the computer able to access the url?"}}

if I allow dns resolution it makes lots of https requests to this domain.

why is it mandatory to connect app.opencode.ai?
how can we run web mode sandboxed?

Originally created by @jokedoke on GitHub (Feb 14, 2026). Originally assigned to: @adamdotdevin on GitHub. ### Question when you start opencode web mode, opencode tries to communicate models.dev and app.opencode.ai at startup. models.dev is ok but I dont understand app.opencode.ai.opencode web mode wont run without communicating app.opencode.ai. tcpdump output ``` listening on enp0s31f6, link-type EN10MB (Ethernet), snapshot length 262144 bytes 06:48:20.956599 IP 192.168.68.109.34244 > 8.8.8.8.domain: 24476+ [1au] A? app.opencode.ai. (44) 06:48:20.956611 IP 192.168.68.109.34244 > 8.8.8.8.domain: 5023+ [1au] AAAA? app.opencode.ai. (44) ``` If I block dns queries to resolve app.opencode.ai. web mode application fails to open. here is the what browser shows when you enter opencode UI. `{"name":"UnknownError","data":{"message":"Error: Unable to connect. Is the computer able to access the url?"}}` if I allow dns resolution it makes lots of https requests to this domain. why is it mandatory to connect app.opencode.ai? how can we run web mode sandboxed?
yindo added the web label 2026-02-16 18:12:09 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 14, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #12445: [FEATURE] Support for custom web app proxy URL in firewalled environments
  • #8549: OpenCode Web does not work without internet access (in a corporate environment)
  • #10972: The WebUI requires network access to load assets from CDN
  • #12083: Unable to connect in intranet environment without external network access
  • #10416: OpenCode is not private by default (external network calls)
  • #11997: Feature request for web server mirror to allow remote access

These issues all relate to the same underlying concern: requiring external network connectivity for the web UI. Consider consolidating efforts around #12445 which proposes adding an OPENCODE_APP_URL environment variable to override the default proxy.

@github-actions[bot] commented on GitHub (Feb 14, 2026): This issue might be a duplicate of existing issues. Please check: - #12445: [FEATURE] Support for custom web app proxy URL in firewalled environments - #8549: OpenCode Web does not work without internet access (in a corporate environment) - #10972: The WebUI requires network access to load assets from CDN - #12083: Unable to connect in intranet environment without external network access - #10416: OpenCode is not private by default (external network calls) - #11997: Feature request for web server mirror to allow remote access These issues all relate to the same underlying concern: requiring external network connectivity for the web UI. Consider consolidating efforts around #12445 which proposes adding an `OPENCODE_APP_URL` environment variable to override the default proxy.
Author
Owner

@jokedoke commented on GitHub (Feb 14, 2026):

do you proxy all requests from / ?

server.ts

        .all("/*", async (c) => {
          const path = c.req.path

          const response = await proxy(`https://app.opencode.ai${path}`, {
            ...c.req,
            headers: {
              ...c.req.raw.headers,
              host: "app.opencode.ai",
            },
          })
          response.headers.set(
            "Content-Security-Policy",
            "default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; media-src 'self' data:; connect-src 'self' data:",
          )
          return response
        }) as unknown as Hono,
  )
@jokedoke commented on GitHub (Feb 14, 2026): do you proxy all requests from / ? server.ts ``` .all("/*", async (c) => { const path = c.req.path const response = await proxy(`https://app.opencode.ai${path}`, { ...c.req, headers: { ...c.req.raw.headers, host: "app.opencode.ai", }, }) response.headers.set( "Content-Security-Policy", "default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; media-src 'self' data:; connect-src 'self' data:", ) return response }) as unknown as Hono, ) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9310