fix(ui): SSE in React chat

This commit is contained in:
Richard Palethorpe
2025-03-28 14:10:10 +00:00
parent d672842a81
commit 29beee6057
3 changed files with 32 additions and 22 deletions

View File

@@ -23,7 +23,7 @@ export function useSSE(agentName) {
}
// Create a new EventSource connection
const sseUrl = `${API_CONFIG.baseUrl}${API_CONFIG.endpoints.sse(agentName)}`;
const sseUrl = new URL(`${API_CONFIG.endpoints.sse(agentName)}`, window.location.origin).href;
const eventSource = new EventSource(sseUrl);
eventSourceRef.current = eventSource;