Support wss if made from https

This commit is contained in:
Nick Mowen 2022-10-21 09:22:40 -06:00
parent 94e74689d3
commit ae89e817a2

View File

@ -3,7 +3,7 @@ import { h } from 'preact';
let ws;
function initStream(camera) {
if (location.protocol == 'https') {
if (location.protocol == 'https:') {
ws = new WebSocket(`wss://${window.location.host}/go2rtc/api/ws?src=${camera}`);
} else {
ws = new WebSocket(`ws://${window.location.host}/go2rtc/api/ws?src=${camera}`);