Start work to allow running the UI behind an HTTPS proxy

This commit is contained in:
Mat 2024-10-19 21:57:57 +00:00
parent a2694ee4a2
commit e5b8132ccf

View File

@ -65,6 +65,7 @@ export class OpenLPService {
private titleCasePipe: TitleCasePipe, private sentenceCasePipe: SentenceCasePipe, private titleCasePipe: TitleCasePipe, private sentenceCasePipe: SentenceCasePipe,
private translateService: TranslateService private translateService: TranslateService
) { ) {
const protocol = window.location.protocol || "http";
const host = window.location.hostname; const host = window.location.hostname;
let port: string; let port: string;
if (environment.production) { if (environment.production) {
@ -73,7 +74,7 @@ export class OpenLPService {
else { else {
port = '4316'; port = '4316';
} }
this.apiURL = `http://${host}:${port}/api/v2`; this.apiURL = `${protocol}://${host}:${port}/api/v2`;
this.host = host; this.host = host;
this.stateChanged$ = new EventEmitter<State>(); this.stateChanged$ = new EventEmitter<State>();
this.webSocketStateChanged$ = new EventEmitter<WebSocketStatus>(); this.webSocketStateChanged$ = new EventEmitter<WebSocketStatus>();