worked backup
This commit is contained in:
@@ -14,7 +14,12 @@ const API_BASE_URL = '/api';
|
||||
* @returns {string}
|
||||
*/
|
||||
export const getWsUrl = (taskId) => {
|
||||
const baseUrl = PUBLIC_WS_URL || `ws://${window.location.hostname}:8000`;
|
||||
let baseUrl = PUBLIC_WS_URL;
|
||||
if (!baseUrl) {
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
// Use the current host and port to allow Vite proxy to handle the connection
|
||||
baseUrl = `${protocol}//${window.location.host}`;
|
||||
}
|
||||
return `${baseUrl}/ws/logs/${taskId}`;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user