From cfbe70390208af9841e4069557d4be8da33fe60d Mon Sep 17 00:00:00 2001 From: linnil1 Date: Sun, 18 Feb 2018 23:02:51 +0800 Subject: [PATCH] Make URL path become more relative --- app/ui.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/ui.js b/app/ui.js index a366620f..e1c68f7f 100644 --- a/app/ui.js +++ b/app/ui.js @@ -164,7 +164,8 @@ var UI = { UI.initSetting('resize', 'off'); UI.initSetting('shared', true); UI.initSetting('view_only', false); - UI.initSetting('path', 'websockify'); + UI.initSetting('path', window.location.pathname.split('/').slice(0, -1).join('/') + + '/websockify'); UI.initSetting('repeaterID', ''); UI.initSetting('reconnect', false); UI.initSetting('reconnect_delay', 5000); @@ -1013,7 +1014,7 @@ var UI = { if(port) { url += ':' + port; } - url += '/' + path + document.location.search; + url += path + document.location.search; UI.rfb = new RFB(document.getElementById('noVNC_container'), url, { shared: UI.getSetting('shared'),