diff --git a/packages/ide/src/fill/client.ts b/packages/ide/src/fill/client.ts index f90943835..18fc83221 100644 --- a/packages/ide/src/fill/client.ts +++ b/packages/ide/src/fill/client.ts @@ -91,8 +91,9 @@ class WebsocketConnection implements ReadWriteConnection { */ private async openSocket(): Promise { this.dispose(); + const wsProto = location.protocol === "https:" ? "wss" : "ws"; const socket = new WebSocket( - `${location.protocol === "https:" ? "wss" : "ws"}://${location.host}`, + `${wsProto}://${location.host}${location.pathname}`, ); socket.binaryType = "arraybuffer"; this.activeSocket = socket;