account for baseUrl

This commit is contained in:
Mary Hipp
2024-01-26 15:59:29 -05:00
committed by psychedelicious
parent e1c2c3905d
commit f79bbd2d6e

View File

@ -45,7 +45,7 @@ export const useSocketIO = () => {
const socketOptions = useMemo(() => { const socketOptions = useMemo(() => {
const options: Partial<ManagerOptions & SocketOptions> = { const options: Partial<ManagerOptions & SocketOptions> = {
timeout: 60000, timeout: 60000,
path: `${window.location.pathname}ws/socket.io`, path: baseUrl ? '/ws/socket.io' : `${window.location.pathname}ws/socket.io`,
autoConnect: false, // achtung! removing this breaks the dynamic middleware autoConnect: false, // achtung! removing this breaks the dynamic middleware
forceNew: true, forceNew: true,
}; };