File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,10 @@ export class WebSocketManager {
1313 this . websocket . close ( ) ;
1414 }
1515
16- const wsBase = `${ window . location . protocol === "https:" ? "wss" : "ws" } ://${ window . location . host } ` ;
16+ // Detect if we're in development mode (frontend on different port than backend)
17+ const isDev = window . location . port === '5173' ;
18+ const backendHost = isDev ? 'localhost:8000' : window . location . host ;
19+ const wsBase = `${ window . location . protocol === "https:" ? "wss" : "ws" } ://${ backendHost } ` ;
1720 console . log ( `📡 Connecting to WebSocket: ${ wsBase } /ws/${ jobId } ` ) ;
1821 this . websocket = new WebSocket ( `${ wsBase } /ws/${ jobId } ` ) ;
1922
@@ -89,7 +92,10 @@ export class WebSocketManager {
8992 this . streamWebSocket . close ( ) ;
9093 }
9194
92- const wsBase = `${ window . location . protocol === "https:" ? "wss" : "ws" } ://${ window . location . host } ` ;
95+ // Detect if we're in development mode (frontend on different port than backend)
96+ const isDev = window . location . port === '5173' ;
97+ const backendHost = isDev ? 'localhost:8000' : window . location . host ;
98+ const wsBase = `${ window . location . protocol === "https:" ? "wss" : "ws" } ://${ backendHost } ` ;
9399 console . log ( `🎥 Connecting to Stream WebSocket: ${ wsBase } /stream/${ jobId } ` ) ;
94100 this . streamWebSocket = new WebSocket ( `${ wsBase } /stream/${ jobId } ` ) ;
95101
You can’t perform that action at this time.
0 commit comments