From b7ef484fbf08a30d32cb7ee36cf347a5fc614924 Mon Sep 17 00:00:00 2001 From: Vitor Rodrigues Date: Sat, 14 Jan 2023 14:48:51 +0100 Subject: [PATCH 1/2] Prefix websocket path with server path Fixes #1737 and it should work for all of the different scenarios where the relative assets also work. This includes, for example: - / - /vnc.html - /vnc/ - /vnc/vnc.html It won't work for: - /vnc (but the assets don't work either, so it's consistent) - or /vnc.html/ (but this results in a 404 by default anyway) --- app/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ui.js b/app/ui.js index c1f6776ed..47a89d396 100644 --- a/app/ui.js +++ b/app/ui.js @@ -180,7 +180,7 @@ const UI = { UI.initSetting('shared', true); UI.initSetting('view_only', false); UI.initSetting('show_dot', false); - UI.initSetting('path', 'websockify'); + UI.initSetting('path', window.location.pathname.substr(1) + '/../websockify'); UI.initSetting('repeaterID', ''); UI.initSetting('reconnect', false); UI.initSetting('reconnect_delay', 5000); From b0c8a2b38ca6eaa07ec66470c67fd57064f67353 Mon Sep 17 00:00:00 2001 From: Vitor Rodrigues Date: Tue, 17 Jan 2023 16:42:49 +0100 Subject: [PATCH 2/2] Replaced deprecated substr method --- app/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ui.js b/app/ui.js index 47a89d396..1e09c16d6 100644 --- a/app/ui.js +++ b/app/ui.js @@ -180,7 +180,7 @@ const UI = { UI.initSetting('shared', true); UI.initSetting('view_only', false); UI.initSetting('show_dot', false); - UI.initSetting('path', window.location.pathname.substr(1) + '/../websockify'); + UI.initSetting('path', window.location.pathname.substring(1) + '/../websockify'); UI.initSetting('repeaterID', ''); UI.initSetting('reconnect', false); UI.initSetting('reconnect_delay', 5000);