Skip to content

fix(preview-ui): derive websocket port from the serving origin - #132

Merged
ompugao merged 1 commit into
masterfrom
fix/preview-ws-port
Aug 21, 2026
Merged

fix(preview-ui): derive websocket port from the serving origin#132
ompugao merged 1 commit into
masterfrom
fix/preview-ws-port

Conversation

@ompugao

@ompugao ompugao commented Aug 21, 2026

Copy link
Copy Markdown
Owner

The websocket URL hardcoded port 3000, so an instance started with --port <n> served its UI correctly but connected to whatever backend happened to be on 3000 — showing the wrong workspace, or failing to connect at all.

Use window.location.host, which already carries the port. vite dev is unaffected: vite.config.ts proxies /ws to localhost:3000, so the URL resolves to the dev server and is forwarded from there.

The websocket URL hardcoded port 3000, so an instance started with
`--port <n>` served its UI correctly but connected to whatever backend
happened to be on 3000 — showing the wrong workspace, or failing to
connect at all.

Use `window.location.host`, which already carries the port. `vite dev`
is unaffected: vite.config.ts proxies /ws to localhost:3000, so the URL
resolves to the dev server and is forwarded from there.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ompugao
ompugao merged commit d97a77a into master Aug 21, 2026
10 checks passed
@ompugao
ompugao deleted the fix/preview-ws-port branch August 21, 2026 04:06
@ompugao
ompugao restored the fix/preview-ws-port branch August 21, 2026 04:07
@ompugao
ompugao deleted the fix/preview-ws-port branch August 21, 2026 04:07
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