add ws/wss protocol selector

This commit is contained in:
NlightN22 2024-03-05 15:57:17 +07:00
parent 6847493fbf
commit 58e59c2708
2 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
# Build commands:
# - $VERSION=0.4
# - $VERSION=0.5
# - rm build -r -Force ; rm ./node_modules/.cache/babel-loader -r -Force ; yarn build
# - docker build --pull --rm -t oncharterliz/multi-frigate:latest -t oncharterliz/multi-frigate:$VERSION "."
# - docker image push --all-tags oncharterliz/multi-frigate

View File

@ -137,8 +137,10 @@ export const proxyApi = {
getEventsSummary: (hostName: string, cameraName: string) =>
instanceApi.get(`proxy/${hostName}/api/${cameraName}/events/summary`).then(res => res.data),
cameraWsURL: (hostName: string, cameraName: string) =>
`ws://${proxyURL.host}/proxy-ws/${hostName}/live/jsmpeg/${cameraName}`,
cameraWsURL: (hostName: string, cameraName: string) => {
const protocol = proxyURL.protocol === 'https:' ? 'wss' : 'ws';
return `${protocol}://${proxyURL.host}/proxy-ws/${hostName}/live/jsmpeg/${cameraName}`
},
cameraImageURL: (hostName: string, cameraName: string) =>
`${proxyPrefix}${hostName}/api/${cameraName}/latest.jpg`,
eventURL: (hostName: string, event: string) =>