7 <meta http-equiv=
"X-UA-Compatible" content=
"IE=edge,chrome=1">
9 <!-- Apple iOS Safari settings -->
10 <meta name=
"viewport" content=
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
11 <meta name=
"apple-mobile-web-app-capable" content=
"yes" />
12 <meta name=
"apple-mobile-web-app-status-bar-style" content=
"black-translucent" />
13 <!-- App Start Icon -->
14 <link rel=
"apple-touch-startup-image" href=
"images/screen_320x460.png" />
15 <!-- For iOS devices set the icon to use if user bookmarks app on their homescreen -->
16 <link rel=
"apple-touch-icon" href=
"images/screen_57x57.png">
19 <link rel=
"stylesheet" href=
"include/base.css" title=
"plain">
21 <script src=
"include/util.js"></script>
24 <body style=
"margin: 0px;">
25 <div id=
"noVNC_screen">
26 <div id=
"noVNC_status_state" style=
"margin-top: 0px; visibility: hidden; position: absolute;"></div>
27 <div id=
"noVNC_status_msg" style=
"margin-top: 0px; visibility: hidden; position: absolute;"></div>
28 <canvas id=
"noVNC_canvas" width=
"640px" height=
"20px">
34 /*jslint white: false */
35 /*global window, $, Util, RFB, */
38 // Load supporting scripts
39 Util.load_scripts([
"webutil.js",
"base64.js",
"websock.js",
"des.js",
40 "keysymdef.js",
"keyboard.js",
"input.js",
"display.js",
41 "jsunzip.js",
"rfb.js"]);
45 function passwordRequired(rfb) {
46 $D('noVNC_status_state').innerHTML =
"pwrequest";
47 $D('noVNC_status_msg').innerHTML =
"needs password";
49 function setPassword() {
50 //rfb.sendPassword($D('password_input').value);
54 function updateState(rfb, state, oldstate, msg) {
57 sm = $D('noVNC_status_msg');
58 ss = $D('noVNC_status_state');
60 if (state !==
"normal") {
66 if (typeof(msg) !== 'undefined') {
71 function xvpInit(ver) {
75 window.onscriptsload = function () {
76 var host, port, password, path, token;
78 WebUtil.init_logging(WebUtil.getQueryVar('logging', 'warn'));
79 document.title = unescape(WebUtil.getQueryVar('title', 'noVNC'));
80 // By default, use the host and port of server that served this file
81 host = WebUtil.getQueryVar('host', window.location.hostname);
82 port = WebUtil.getQueryVar('port', window.location.port);
83 password = WebUtil.getQueryVar('password', '');
84 path = WebUtil.getQueryVar('path', 'websockify');
86 if ((!host) || (!port)) {
87 updateState('failed',
"Must specify host and port in URL");
91 rfb = new RFB({'target': $D('noVNC_canvas'),
92 'encrypt': WebUtil.getQueryVar('encrypt',
93 (window.location.protocol ===
"https:")),
94 'repeaterID': WebUtil.getQueryVar('repeaterID', ''),
95 'true_color': WebUtil.getQueryVar('true_color', true),
96 'local_cursor': WebUtil.getQueryVar('cursor', true),
97 'shared': WebUtil.getQueryVar('shared', true),
98 'view_only': WebUtil.getQueryVar('view_only', false),
99 'updateState': updateState,
100 'onXvpInit': xvpInit,
101 'onPasswordRequired': passwordRequired});
102 rfb.connect(host, port, password, path);
104 $D(
"noVNC_screen").onmouseover = function(e) {