Skip to content

fix: use BASE_PATH for WebSocket URL in subpath deployments#5

Open
rjmayott wants to merge 1 commit intocloudcli-ai:mainfrom
rjmayott:fix/base-path-websocket
Open

fix: use BASE_PATH for WebSocket URL in subpath deployments#5
rjmayott wants to merge 1 commit intocloudcli-ai:mainfrom
rjmayott:fix/base-path-websocket

Conversation

@rjmayott
Copy link
Copy Markdown

Summary

When CloudCLI is served from a subpath (e.g. /s/myproject/) via a reverse proxy, the terminal plugin's WebSocket URL is missing the base path prefix. It connects to /plugin-ws/web-terminal instead of /s/myproject/plugin-ws/web-terminal, causing the connection to fail.

Fix

Read window.__CLOUDCLI_BASE_PATH__ (injected by CloudCLI's server at runtime) and prefix the WebSocket URL. Falls back to empty string when not set, so behavior is unchanged for root deployments.

Related: siteboon/claudecodeui#687 (adds BASE_PATH support to CloudCLI)

Test plan

  • Tested with CloudCLI served at /s/personal/ behind reverse proxy
  • Terminal plugin connects and works after this fix
  • No change in behavior when served from root /

When CloudCLI is served from a subpath (e.g. /s/myproject/), the
plugin-ws WebSocket URL needs the base path prefix. Reads
window.__CLOUDCLI_BASE_PATH__ which CloudCLI injects at runtime.

Without this, the WebSocket connects to /plugin-ws/web-terminal
instead of /s/myproject/plugin-ws/web-terminal and fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant