diff --git a/docs/installation.md b/docs/installation.md index 03c0b8a7..d1fc87e0 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -336,6 +336,7 @@ These are the environmental options available on meet backend. | LIVEKIT_API_SECRET | LiveKit API secret | | | LIVEKIT_API_URL | LiveKit API URL | | | LIVEKIT_VERIFY_SSL | Verify SSL for LiveKit connections | true | +| LIVEKIT_FORCE_WSS_PROTOCOL | Enables WSS protocol conversion for legacy browser compatibility (Firefox <124, Chrome <125, Edge <125) where HTTPS URLs fail in WebSocket() constructor. | false | | RESOURCE_DEFAULT_ACCESS_LEVEL | Default resource access level for rooms | public | | ALLOW_UNREGISTERED_ROOMS | Allow usage of unregistered rooms | true | | RECORDING_ENABLE | Record meeting option | false | diff --git a/src/backend/core/api/__init__.py b/src/backend/core/api/__init__.py index beb0ec3b..5e400ca0 100644 --- a/src/backend/core/api/__init__.py +++ b/src/backend/core/api/__init__.py @@ -52,6 +52,7 @@ def get_frontend_configuration(request): }, "livekit": { "url": settings.LIVEKIT_CONFIGURATION["url"], + "force_wss_protocol": settings.LIVEKIT_FORCE_WSS_PROTOCOL, "enable_firefox_proxy_workaround": settings.LIVEKIT_ENABLE_FIREFOX_PROXY_WORKAROUND, }, } diff --git a/src/backend/meet/settings.py b/src/backend/meet/settings.py index f3ad1648..a7f4af11 100755 --- a/src/backend/meet/settings.py +++ b/src/backend/meet/settings.py @@ -492,6 +492,9 @@ class Base(Configuration): ), "url": values.Value(environ_name="LIVEKIT_API_URL", environ_prefix=None), } + LIVEKIT_FORCE_WSS_PROTOCOL = values.BooleanValue( + False, environ_name="LIVEKIT_FORCE_WSS_PROTOCOL", environ_prefix=None + ) LIVEKIT_ENABLE_FIREFOX_PROXY_WORKAROUND = values.BooleanValue( environ_name="LIVEKIT_ENABLE_FIREFOX_PROXY_WORKAROUND", environ_prefix=None, diff --git a/src/frontend/src/api/useConfig.ts b/src/frontend/src/api/useConfig.ts index 887c6223..3dc4feb5 100644 --- a/src/frontend/src/api/useConfig.ts +++ b/src/frontend/src/api/useConfig.ts @@ -39,6 +39,7 @@ export interface ApiConfig { manifest_link?: string livekit: { url: string + force_wss_protocol: boolean enable_firefox_proxy_workaround: boolean } } diff --git a/src/frontend/src/features/rooms/components/Conference.tsx b/src/frontend/src/features/rooms/components/Conference.tsx index 4e71df70..824f91eb 100644 --- a/src/frontend/src/features/rooms/components/Conference.tsx +++ b/src/frontend/src/features/rooms/components/Conference.tsx @@ -162,6 +162,20 @@ export const Conference = ({ kind: null, }) + /* + * Ensure stable WebSocket connection URL. This is critical for legacy browser compatibility + * (Firefox <124, Chrome <125, Edge <125) where HTTPS URLs in WebSocket() constructor + * may fail - the force_wss_protocol flag allows explicit WSS protocol conversion + */ + const serverUrl = useMemo(() => { + const livekit_url = apiConfig?.livekit.url + if (!livekit_url) return + if (apiConfig?.livekit.force_wss_protocol) { + return livekit_url.replace('https://', 'wss://') + } + return livekit_url + }, [apiConfig?.livekit]) + const { t } = useTranslation('rooms') if (isCreateError) { // this error screen should be replaced by a proper waiting room for anonymous user. @@ -185,7 +199,7 @@ export const Conference = ({