Websocket: apparently this needs to be the full URL
This commit is contained in:
@@ -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');
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user