This commit is contained in:
Ryan Lovett 2018-04-19 00:12:00 +00:00 committed by GitHub
commit a7e6aad09f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 1 deletions

View File

@ -187,7 +187,21 @@
}
var password = WebUtil.getConfigVar('password', '');
var path = WebUtil.getConfigVar('path', 'websockify');
var defaultPath = 'websockify';
// If noVNC is not being served at the root path,
// prefix the default websocket path with the server path.
var pathName = window.location.pathname.slice(1);
if (pathName.length != 0) { // We are not at the root path
if (pathName.slice(-1) == '/') {
// There's a trailing slash.
defaultPath = pathName + 'websockify';
} else {
// There's no trailing slash.
defaultPath = pathName + '/websockify';
}
}
var path = WebUtil.getConfigVar('path', defaultPath);
// If a token variable is passed in, set the parameter in a cookie.
// This is used by nova-novncproxy.