Skip to content

Commit 15ec1e6

Browse files
committed
✨(devex) add LIVEKIT_INTERNAL_URL for server-to-server communication
Introduced a LIVEKIT_INTERNAL_URL environment variable for container-to-container LiveKit communication, using http://livekit:7880 in development. LIVEKIT_API_URL continues to serve browser-facing requests, and create_livekit_client() prefers the internal URL when set, preserving backwards compatibility.
1 parent 7c05aed commit 15ec1e6

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/backend/core/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,11 @@ def create_livekit_client(custom_configuration=None):
212212
custom_session = aiohttp.ClientSession(connector=connector)
213213

214214
# Use default configuration if none provided
215-
configuration = custom_configuration or settings.LIVEKIT_CONFIGURATION
215+
configuration = {
216+
**(custom_configuration or settings.LIVEKIT_CONFIGURATION),
217+
"url": settings.LIVEKIT_INTERNAL_URL
218+
or (custom_configuration or settings.LIVEKIT_CONFIGURATION)["url"],
219+
}
216220

217221
return LiveKitAPI(session=custom_session, **configuration)
218222

src/backend/meet/settings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,11 @@ class Base(Configuration):
619619
),
620620
"url": values.Value(environ_name="LIVEKIT_API_URL", environ_prefix=None),
621621
}
622+
# Internal URL for server-to-server LiveKit API calls (e.g. container-to-container).
623+
# Defaults to LIVEKIT_API_URL when not set.
624+
LIVEKIT_INTERNAL_URL = values.Value(
625+
"", environ_name="LIVEKIT_INTERNAL_URL", environ_prefix=None
626+
)
622627
LIVEKIT_FORCE_WSS_PROTOCOL = values.BooleanValue(
623628
False, environ_name="LIVEKIT_FORCE_WSS_PROTOCOL", environ_prefix=None
624629
)

0 commit comments

Comments
 (0)