add relpath for websocker uri

This commit is contained in:
Tommy Tang 2017-08-31 09:49:16 +00:00
parent 9964a55d49
commit 214e92f4a9
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
FROM python
ENV VER=${VER:-relpath} \
ENV VER=${VER:-master} \
REPO=https://github.com/twhtanghk/noVNC \
APP=/usr/src/app

View File

@ -392,7 +392,10 @@ RFB.prototype = {
uri = this._encrypt ? 'wss' : 'ws';
}
uri += '://' + this._rfb_host + ':' + this._rfb_port + '/' + this._rfb_path;
var relpath = location.pathname.split('/');
relpath.splice(1, -1);
relpath = relpath.join('/') + '/';
uri += '://' + this._rfb_host + ':' + this._rfb_port + relpath + this._rfb_path;
Log.Info("connecting to " + uri);
try {