mirror of
https://gitlab.com/openlp/web-remote.git
synced 2024-12-22 11:32:47 +00:00
Also support WebSocket SSL
This commit is contained in:
parent
c3437ad30b
commit
24684d032e
@ -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 = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user