mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-22 05:32:12 -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) => {
|
||||
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) => {
|
||||
ws.onmessage = (event) => {
|
||||
|
||||
@@ -269,7 +269,8 @@ export class DownloadManager {
|
||||
this.loadingManager.show('Downloading LoRA...', 0);
|
||||
|
||||
// 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) => {
|
||||
const data = JSON.parse(event.data);
|
||||
if (data.status === 'progress') {
|
||||
|
||||
Reference in New Issue
Block a user