Fix bug with websocket protocol

This commit is contained in:
Mat 2024-10-23 07:07:42 +00:00
parent 93a8f428be
commit 429cb304a4

View File

@ -8,7 +8,7 @@ export function createWebSocket<T>(
): Observable<T> { ): Observable<T> {
return new Observable((observer) => { return new Observable((observer) => {
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const ws = new WebSocket(`${protocol}://${host}:${wsPort}/${endpoint}`); const ws = new WebSocket(`${protocol}//${host}:${wsPort}/${endpoint}`);
ws.onmessage = (e) => { ws.onmessage = (e) => {
const reader = new FileReader(); const reader = new FileReader();
reader.onload = () => { reader.onload = () => {