From 9303c5acfe2c97ba435fd8de05cfcccf44cf16f1 Mon Sep 17 00:00:00 2001 From: James Magahern Date: Wed, 5 Mar 2025 00:19:38 -0800 Subject: [PATCH] Websocket: apparently this needs to be the full URL --- frontend/src/components/App.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/App.tsx b/frontend/src/components/App.tsx index 3a2b061..3d87587 100644 --- a/frontend/src/components/App.tsx +++ b/frontend/src/components/App.tsx @@ -180,7 +180,9 @@ const App: React.FC = () => { } }, [fetchPlaylist, fetchNowPlaying, fetchFavorites]); - useWebSocket('/api/events', { + const wsUrl = `${window.location.protocol === 'https:' ? 'wss:' : 'ws:'}//${window.location.host}/api/events`; + console.log('Connecting to WebSocket at', wsUrl); + useWebSocket(wsUrl, { onOpen: () => { console.log('WebSocket connected'); },