From 294f1a001c5175f1e7a0d360295df41a835f0fb5 Mon Sep 17 00:00:00 2001
From: patrick-motsch
Date: Sun, 15 Feb 2026 00:12:45 +0100
Subject: [PATCH] fix(teamsbot): Use APP_API_URL for WebSocket URL to ensure
https/wss
Co-authored-by: Cursor
---
modules/features/teamsbot/routeFeatureTeamsbot.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/modules/features/teamsbot/routeFeatureTeamsbot.py b/modules/features/teamsbot/routeFeatureTeamsbot.py
index 997b9a58..14ccfa18 100644
--- a/modules/features/teamsbot/routeFeatureTeamsbot.py
+++ b/modules/features/teamsbot/routeFeatureTeamsbot.py
@@ -122,9 +122,11 @@ async def startSession(
createdSession = interface.createSession(sessionData)
sessionId = createdSession.get("id")
- # Derive gateway base URL from the incoming request so the bridge
- # can build full callback/WS URLs targeting this specific gateway instance.
- gatewayBaseUrl = str(request.base_url).rstrip("/")
+ # Use APP_API_URL from global config for the gateway base URL
+ # request.base_url can be http:// behind a reverse proxy even when client uses https://
+ from modules.shared.configuration import APP_CONFIG
+ appApiUrl = APP_CONFIG.get("APP_API_URL", "")
+ gatewayBaseUrl = appApiUrl.rstrip("/") if appApiUrl else str(request.base_url).rstrip("/")
# Start the bot in background (join meeting via bridge)
service = TeamsbotService(context.user, mandateId, instanceId, config)