safety
This commit is contained in:
parent
879e9b4228
commit
c3cb36c8d6
51 changed files with 2290 additions and 1467 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { API_BASE_URL } from '@/lib/api';
|
||||
import { browserLog } from '@/utils/browserLog';
|
||||
|
||||
export interface WebSocketMessage {
|
||||
|
|
@ -55,7 +56,10 @@ export function useWebSocket({
|
|||
reconnectTimeoutRef.current = null;
|
||||
}
|
||||
|
||||
const wsUrl = `ws://localhost:2003/ws?runId=${runId}`;
|
||||
const url = new URL('/ws', API_BASE_URL);
|
||||
url.protocol = url.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
url.searchParams.set('runId', runId);
|
||||
const wsUrl = url.toString();
|
||||
browserLog.log('Connecting to WebSocket:', wsUrl);
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue