From c74551c2ae0611f3ef0e691dc93a38372f366765 Mon Sep 17 00:00:00 2001 From: Ameno Osman Date: Tue, 20 Jan 2026 16:05:27 -0800 Subject: [PATCH] fix(ui): parse gatewayUrl from URL params for remote gateway access Adds support for passing `gatewayUrl` as a URL parameter to the WebChat UI, allowing the control-ui to connect to a remote gateway (e.g., VPS) instead of defaulting to localhost. Usage: http://localhost:5173/?gatewayUrl=ws://:18789&token= Co-Authored-By: Claude Opus 4.5 --- ui/src/ui/app-settings.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/src/ui/app-settings.ts b/ui/src/ui/app-settings.ts index e5ba2a95d..f9139afbd 100644 --- a/ui/src/ui/app-settings.ts +++ b/ui/src/ui/app-settings.ts @@ -62,6 +62,7 @@ export function applySettingsFromUrl(host: SettingsHost) { const tokenRaw = params.get("token"); const passwordRaw = params.get("password"); const sessionRaw = params.get("session"); + const gatewayUrlRaw = params.get("gatewayUrl"); let shouldCleanUrl = false; if (tokenRaw != null) { @@ -94,6 +95,15 @@ export function applySettingsFromUrl(host: SettingsHost) { } } + if (gatewayUrlRaw != null) { + const gatewayUrl = gatewayUrlRaw.trim(); + if (gatewayUrl && gatewayUrl !== host.settings.gatewayUrl) { + applySettings(host, { ...host.settings, gatewayUrl }); + } + params.delete("gatewayUrl"); + shouldCleanUrl = true; + } + if (!shouldCleanUrl) return; const url = new URL(window.location.href); url.search = params.toString();