diff --git a/packages/web-util/src/live-reload.ts b/packages/web-util/src/live-reload.ts index 8e5e7da71..407ef9e84 100644 --- a/packages/web-util/src/live-reload.ts +++ b/packages/web-util/src/live-reload.ts @@ -2,8 +2,7 @@ function setupLiveReload(): void { const protocol = window.location.protocol === "http:" ? "ws:" : "wss:"; - const port = window.location.protocol === "http:" ? "8080" : "8081"; - const ws = new WebSocket(`${protocol}//localhost:${port}/ws`); + const ws = new WebSocket(`${protocol}//${window.location.hostname}:${window.location.port}/ws`); ws.addEventListener("message", (message) => { try {