Make URL path become more relative

This commit is contained in:
linnil1 2018-02-18 23:02:51 +08:00
parent 9045a68f1b
commit cfbe703902
1 changed files with 3 additions and 2 deletions

View File

@ -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'),