From d7d5d75386f08a99362d456b4bc0e87633fa1a19 Mon Sep 17 00:00:00 2001 From: Andrew Melnick Date: Tue, 5 Aug 2025 14:53:27 -0600 Subject: [PATCH] app: fix default path when running at a subpath Instead of hardcoding default path to "websockify", determine the subpath the app is running at by inspecting the current window location, and default to "/websockify" instead. Trim the leading and trailing slashes to ensure that the path is well-formed. --- app/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ui.js b/app/ui.js index 83def8d30..f33802c8d 100644 --- a/app/ui.js +++ b/app/ui.js @@ -269,7 +269,7 @@ const UI = { UI.initSetting('shared', true); UI.initSetting('view_only', false); UI.initSetting('show_dot', false); - UI.initSetting('path', 'websockify'); + UI.initSetting('path', new URL('./websockify', window.location.toString().replace(/\/$/, '')+'/').pathname.replace(/^\//, '')); UI.initSetting('repeaterID', ''); UI.initSetting('reconnect', false); UI.initSetting('reconnect_delay', 5000);