diff options
author | Christian Beier <dontmind@freeshell.org> | 2012-04-12 18:41:14 +0200 |
---|---|---|
committer | Christian Beier <dontmind@freeshell.org> | 2012-04-12 18:41:14 +0200 |
commit | 98f4037785246f77e544bab9196f076fe310be16 (patch) | |
tree | 9531342656a66e0963ff9b55a00db2fe3222e31d /webclients/novnc/vnc_auto.html | |
parent | efcdab50cc10ad121653bfff0da441495af461d3 (diff) | |
download | libtdevnc-98f4037785246f77e544bab9196f076fe310be16.tar.gz libtdevnc-98f4037785246f77e544bab9196f076fe310be16.zip |
Update our copy of noVNC.
Bugfixes and support for tight encoding with zlib.
Diffstat (limited to 'webclients/novnc/vnc_auto.html')
-rw-r--r-- | webclients/novnc/vnc_auto.html | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/webclients/novnc/vnc_auto.html b/webclients/novnc/vnc_auto.html index a500b79..8d370b5 100644 --- a/webclients/novnc/vnc_auto.html +++ b/webclients/novnc/vnc_auto.html @@ -84,16 +84,25 @@ } window.onload = function () { - var host, port, password, path; + var host, port, password, path, token; $D('sendCtrlAltDelButton').style.display = "inline"; $D('sendCtrlAltDelButton').onclick = sendCtrlAltDel; document.title = unescape(WebUtil.getQueryVar('title', 'noVNC')); - host = WebUtil.getQueryVar('host', null); - port = WebUtil.getQueryVar('port', null); + // By default, use the host and port of server that served this file + host = WebUtil.getQueryVar('host', window.location.hostname); + port = WebUtil.getQueryVar('port', window.location.port); + + // If a token variable is passed in, set the parameter in a cookie. + // This is used by nova-novncproxy. + token = WebUtil.getQueryVar('token', null); + if (token) { + WebUtil.createCookie('token', token, 1) + } + password = WebUtil.getQueryVar('password', ''); - path = WebUtil.getQueryVar('path', ''); + path = WebUtil.getQueryVar('path', 'websockify'); if ((!host) || (!port)) { updateState('failed', "Must specify host and port in URL"); @@ -101,10 +110,12 @@ } rfb = new RFB({'target': $D('noVNC_canvas'), - 'encrypt': WebUtil.getQueryVar('encrypt', false), + 'encrypt': WebUtil.getQueryVar('encrypt', + (window.location.protocol === "https:")), 'true_color': WebUtil.getQueryVar('true_color', true), 'local_cursor': WebUtil.getQueryVar('cursor', true), 'shared': WebUtil.getQueryVar('shared', true), + 'view_only': WebUtil.getQueryVar('view_only', false), 'updateState': updateState, 'onPasswordRequired': passwordRequired}); rfb.connect(host, port, password, path); |