diff --git a/invokeai/frontend/web/src/services/events/middleware.ts b/invokeai/frontend/web/src/services/events/middleware.ts index 0c3b275274..75f2d48de8 100644 --- a/invokeai/frontend/web/src/services/events/middleware.ts +++ b/invokeai/frontend/web/src/services/events/middleware.ts @@ -12,8 +12,9 @@ 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[0] = { timeout: 60000,