mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 15:15:44 -03:00
Update WebSocket connection to use secure protocol based on current window location
This commit is contained in:
@@ -113,7 +113,8 @@ export async function fetchCivitai() {
|
|||||||
|
|
||||||
await state.loadingManager.showWithProgress(async (loading) => {
|
await state.loadingManager.showWithProgress(async (loading) => {
|
||||||
try {
|
try {
|
||||||
ws = new WebSocket(`ws://${window.location.host}/ws/fetch-progress`);
|
const wsProtocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
|
||||||
|
const ws = new WebSocket(`${wsProtocol}${window.location.host}/ws/fetch-progress`);
|
||||||
|
|
||||||
const operationComplete = new Promise((resolve, reject) => {
|
const operationComplete = new Promise((resolve, reject) => {
|
||||||
ws.onmessage = (event) => {
|
ws.onmessage = (event) => {
|
||||||
|
|||||||
@@ -269,7 +269,8 @@ export class DownloadManager {
|
|||||||
this.loadingManager.show('Downloading LoRA...', 0);
|
this.loadingManager.show('Downloading LoRA...', 0);
|
||||||
|
|
||||||
// Setup WebSocket for progress updates
|
// Setup WebSocket for progress updates
|
||||||
const ws = new WebSocket(`ws://${window.location.host}/ws/fetch-progress`);
|
const wsProtocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
|
||||||
|
const ws = new WebSocket(`${wsProtocol}${window.location.host}/ws/fetch-progress`);
|
||||||
ws.onmessage = (event) => {
|
ws.onmessage = (event) => {
|
||||||
const data = JSON.parse(event.data);
|
const data = JSON.parse(event.data);
|
||||||
if (data.status === 'progress') {
|
if (data.status === 'progress') {
|
||||||
|
|||||||
Reference in New Issue
Block a user