mirror of
https://gitlab.com/openlp/web-remote.git
synced 2024-12-22 03:22:48 +00:00
Merge branch 'mjaggard-master-patch-72798' into 'master'
Allow running the UI behind an HTTPS proxy See merge request openlp/web-remote!135
This commit is contained in:
commit
9a8f34b574
@ -7,7 +7,8 @@ export function createWebSocket<T>(
|
|||||||
endpoint = ''
|
endpoint = ''
|
||||||
): Observable<T> {
|
): Observable<T> {
|
||||||
return new Observable((observer) => {
|
return new Observable((observer) => {
|
||||||
const ws = new WebSocket(`ws://${host}:${wsPort}/${endpoint}`);
|
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||||
|
const ws = new WebSocket(`${protocol}//${host}:${wsPort}/${endpoint}`);
|
||||||
ws.onmessage = (e) => {
|
ws.onmessage = (e) => {
|
||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
reader.onload = () => {
|
reader.onload = () => {
|
||||||
|
@ -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;
|
||||||
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>();
|
||||||
|
Loading…
Reference in New Issue
Block a user