[FEATURE]: Allow baseUrl to be overrided by web command or server config. #4799

Open
opened 2026-02-16 17:45:29 -05:00 by yindo · 1 comment
Owner

Originally created by @singlewind on GitHub (Jan 11, 2026).

Originally assigned to: @adamdotdevin on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

When run opencode web command. By default, the server will be run at http://localhost:4096. And the url will be defaulted by frontend code as well. If the port or hostname changed, the frontend baseUrl will be changed as well. However, in some situation, eg. A load balancer terminate TLS before the endpoint, will cause issue. The baseUrl is different with server config. Because opencode command bundled the frontend assets, it is not easy to make the baseUrl change.

Current workaround will be host API by running opencode serve. Build assets separately and host it.

Originally created by @singlewind on GitHub (Jan 11, 2026). Originally assigned to: @adamdotdevin on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request When run `opencode web` command. By default, the server will be run at `http://localhost:4096`. And the url will be defaulted by frontend code as well. If the port or hostname changed, the frontend baseUrl will be changed as well. However, in some situation, eg. A load balancer terminate TLS before the endpoint, will cause issue. The baseUrl is different with `server` config. Because opencode command bundled the frontend assets, it is not easy to make the baseUrl change. Current workaround will be host API by running `opencode serve`. Build assets separately and host it.
yindo added the discussionweb labels 2026-02-16 17:45:29 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 11, 2026):

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

  • #7624: Base path / prefix routing support - Related to URL prefix/base path configuration when embedding OpenCode in larger platforms
  • #7371: feat: support configuring default server URL for desktop - (CLOSED) Related to server configuration and URL setup

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 11, 2026): This issue might be a duplicate of existing issues. Please check: - #7624: Base path / prefix routing support - Related to URL prefix/base path configuration when embedding OpenCode in larger platforms - #7371: feat: support configuring default server URL for desktop - (CLOSED) Related to server configuration and URL setup Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4799