diff --git a/ui/src/hooks/use-websocket.ts b/ui/src/hooks/use-websocket.ts index 16abc65f..198b10ca 100644 --- a/ui/src/hooks/use-websocket.ts +++ b/ui/src/hooks/use-websocket.ts @@ -69,7 +69,8 @@ export function useWebSocket() { } setStatus('connecting'); - const ws = new WebSocket(`ws://${window.location.host}`); + const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; + const ws = new WebSocket(`${protocol}//${window.location.host}`); wsRef.current = ws; ws.onopen = () => {