diff --git a/static/js/api/loraApi.js b/static/js/api/loraApi.js index fe961412..86278c21 100644 --- a/static/js/api/loraApi.js +++ b/static/js/api/loraApi.js @@ -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) => { diff --git a/static/js/managers/DownloadManager.js b/static/js/managers/DownloadManager.js index 2a0f5746..75631bb1 100644 --- a/static/js/managers/DownloadManager.js +++ b/static/js/managers/DownloadManager.js @@ -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') {