Skip to content

Conversation

@sreya
Copy link
Contributor

@sreya sreya commented Nov 17, 2025

  • Also fixes 'made dev-server` not properly starting

Add .coder to allowedHosts for both dev server and preview mode to support
Coder workspace access patterns. When MUX_VITE_HOST=0.0.0.0, allow all hosts.

fix: replace 0.0.0.0 backend URL with client hostname

When VITE_BACKEND_URL contains 0.0.0.0 (server bind address), replace it
with window.location.hostname so WebSocket clients can actually connect.

Fixes: WebSocket connection to 'ws://0.0.0.0:3000/ws' failed

fix: update dev-server to watch correct output paths

nodemon was watching dist/main.js but build outputs to dist/cli/index.js
and dist/cli/server.js. Update both Windows and Unix dev-server targets.

fix: use clientPort for Vite HMR when binding to 0.0.0.0

When MUX_VITE_HOST=0.0.0.0, use clientPort instead of explicit host to
let the browser use its own hostname for HMR WebSocket connections.

Fixes: WebSocket connection to 'ws://0.0.0.0:5173/?token=...' failed
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