mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
Support wss if made from https
This commit is contained in:
parent
0e000e7ee6
commit
94e74689d3
@ -3,7 +3,12 @@ import { h } from 'preact';
|
|||||||
let ws;
|
let ws;
|
||||||
|
|
||||||
function initStream(camera) {
|
function initStream(camera) {
|
||||||
|
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}`);
|
ws = new WebSocket(`ws://${window.location.host}/go2rtc/api/ws?src=${camera}`);
|
||||||
|
}
|
||||||
|
|
||||||
ws.onopen = () => {
|
ws.onopen = () => {
|
||||||
pc.createOffer().then(offer => {
|
pc.createOffer().then(offer => {
|
||||||
pc.setLocalDescription(offer).then(() => {
|
pc.setLocalDescription(offer).then(() => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user