mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
feat(ui) working on making socket URL dynamic
This commit is contained in:
committed by
psychedelicious
parent
b31b8d31ad
commit
793a4ddbb2
@@ -27,8 +27,15 @@ import {
|
||||
invokeSession,
|
||||
isFulfilledCreateSession,
|
||||
} from 'services/thunks/session';
|
||||
import { OpenAPI } from 'services/api';
|
||||
|
||||
const socket_url = `ws://${window.location.host}`;
|
||||
let socket_url = `ws://${window.location.host}`;
|
||||
|
||||
// if building in package mode, replace socket url with open api base url minus the http protocol
|
||||
if (import.meta.env.MODE === 'package' && OpenAPI.BASE) {
|
||||
//eslint-disable-next-line
|
||||
socket_url = OpenAPI.BASE.replace(/^https?\:\/\//i, '');
|
||||
}
|
||||
|
||||
const socket = io(socket_url, {
|
||||
timeout: 60000,
|
||||
|
||||
Reference in New Issue
Block a user