mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-06 09:22:04 -04:00
go2rtc serves its API under /api, and its websocket at /api/ws. zmc appends /streams to ZM_GO2RTC_PATH and the browser appends /ws, so the setting only worked if it ended in /api. The natural value to enter is the server address, http://host:1984, and with that zmc reached /streams, which is go2rtc's RTSPtoWeb compatibility endpoint, so no stream was ever registered, and the browser's /ws was a 404. Where another player was available the failure went unnoticed. Normalise the setting where URLs are built from it: a trailing slash is dropped and /api is added unless the path already ends in it, which also covers go2rtc behind a reverse proxy at a sub-path. - Go2RTCApiEndpoint() in zm_utils, used by zmc's Go2RTCManager. - go2rtcApiUrl() in skin.js, used by MonitorStream and the console thumbnail stream. It assigns the path once, since stripping the slash from a bare host's "/" and appending gave "//api", as the old pathname += '/ws' gave "//ws". - The option's help says the suffix is optional. Catch2 and node tests cover bare hosts, trailing slashes, an existing /api, a proxy sub-path and credentials in the URL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>