Improvements to URL handling in the webapp allowing for SSL (when behind a proxy) #104296

Merged
Sybren A. Stüvel merged 5 commits from william-at-counter/flamenco:main into main 2024-04-11 15:00:55 +02:00
Showing only changes of commit 746a5f4913 - Show all commits

View File

@ -4,15 +4,10 @@ let url = new URL(window.location.href);
if (url.port == '8081') { if (url.port == '8081') {
url.port = '8080'; url.port = '8080';
} }
url.pathname = '/';
const flamencoAPIURL = url.href;
url.protocol = 'ws:';
const websocketURL = url.href;
const URLs = { const URLs = {
api: flamencoAPIURL, api: `${url.protocol}//${url.hostname}:${url.port}/`,
ws: websocketURL, ws: `${url.protocol.replace('http', 'ws')}//${url.hostname}:${url.port}/`,
}; };
// console.log("Flamenco API:", URLs.api); // console.log("Flamenco API:", URLs.api);