fix https/wss behind reverse proxy

This commit is contained in:
Zerdoumi 2023-08-01 15:57:13 +02:00 committed by psychedelicious
parent 0c1a7e72d4
commit 242d860a47

View File

@ -13,7 +13,8 @@ import { socketSubscribed, socketUnsubscribed } from './actions';
export const socketMiddleware = () => {
let areListenersSet = false;
let socketUrl = `ws://${window.location.host}`;
let wsProtocol = window.location.protocol === 'https:' ? 'wss' : 'ws';
let socketUrl = `${wsProtocol}://${window.location.host}`;
const socketOptions: Parameters<typeof io>[0] = {
timeout: 60000,