feat: Enable go2rtc live stream proxying (#2159)

- Closes #1984
This commit is contained in:
Dermot Duffy
2025-08-28 21:19:19 -07:00
committed by GitHub
parent c3d95a5b32
commit bc5022ef1a
29 changed files with 479 additions and 282 deletions
+4
View File
@@ -323,3 +323,7 @@ export const generateFloatApproximatelyEqualsCustomizer = (
: undefined;
};
};
export const convertHTTPAdressToWebsocket = (url: string): string => {
return url.replace(/^http/i, 'ws');
};
-23
View File
@@ -1,23 +0,0 @@
import { homeAssistantSignPath } from '../ha/sign-path';
import { HomeAssistant } from '../ha/types';
import { Endpoint } from '../types';
import { errorToConsole } from './basic';
export const convertEndpointAddressToSignedWebsocket = async (
hass: HomeAssistant,
endpoint: Endpoint,
expires?: number,
): Promise<string | null> => {
if (!endpoint.sign) {
return endpoint.endpoint;
}
let response: string | null | undefined;
try {
response = await homeAssistantSignPath(hass, endpoint.endpoint, expires);
} catch (e) {
errorToConsole(e as Error);
}
return response ? response.replace(/^http/i, 'ws') : null;
};