Skip to content

Commit 242d860

Browse files
sohelzerdoumipsychedelicious
authored andcommitted
fix https/wss behind reverse proxy
1 parent 0c1a7e7 commit 242d860

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

invokeai/frontend/web/src/services/events/middleware.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import { socketSubscribed, socketUnsubscribed } from './actions';
1212

1313
export const socketMiddleware = () => {
1414
let areListenersSet = false;
15-
16-
let socketUrl = `ws://${window.location.host}`;
15+
16+
let wsProtocol = window.location.protocol === 'https:' ? 'wss' : 'ws';
17+
let socketUrl = `${wsProtocol}://${window.location.host}`;
1718

1819
const socketOptions: Parameters<typeof io>[0] = {
1920
timeout: 60000,

0 commit comments

Comments
 (0)