|
@@ -0,0 +1,87 @@
|
|
|
|
+<!DOCTYPE html>
|
|
|
|
+<html>
|
|
|
|
+ <!--
|
|
|
|
+ noVNC Example: Automatically connect on page load.
|
|
|
|
+ Copyright (C) 2011 Joel Martin
|
|
|
|
+ Licensed under LGPL-3 (see LICENSE.txt)
|
|
|
|
+
|
|
|
|
+ Connect parameters are provided in query string:
|
|
|
|
+ http://example.com/?host=HOST&port=PORT&encrypt=1&true_color=1
|
|
|
|
+ -->
|
|
|
|
+ <head>
|
|
|
|
+ <title>noVNC</title>
|
|
|
|
+ <meta http-equiv="X-UA-Compatible" content="chrome=1">
|
|
|
|
+ <link rel="stylesheet" href="include/base.css" title="plain">
|
|
|
|
+ <!--
|
|
|
|
+ <script type='text/javascript'
|
|
|
|
+ src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
|
|
|
|
+ -->
|
|
|
|
+ <script src="include/vnc.js"></script>
|
|
|
|
+ </head>
|
|
|
|
+
|
|
|
|
+ <body style="margin: 0px;">
|
|
|
|
+ <div id="noVNC_screen">
|
|
|
|
+ <canvas id="noVNC_canvas" width="640px" height="20px">
|
|
|
|
+ Canvas not supported.
|
|
|
|
+ </canvas>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <script>
|
|
|
|
+ /*jslint white: false */
|
|
|
|
+ /*global window, $, Util, RFB, */
|
|
|
|
+ "use strict";
|
|
|
|
+
|
|
|
|
+ var rfb;
|
|
|
|
+
|
|
|
|
+ function passwordRequired(rfb) {
|
|
|
|
+ }
|
|
|
|
+ function setPassword() {
|
|
|
|
+ rfb.sendPassword($D('password_input').value);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ function sendCtrlAltDel() {
|
|
|
|
+ rfb.sendCtrlAltDel();
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ function updateState(rfb, state, oldstate, msg) {
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ window.onload = function () {
|
|
|
|
+ var host, port, password, path, token;
|
|
|
|
+
|
|
|
|
+ document.title = unescape(WebUtil.getQueryVar('title', 'noVNC'));
|
|
|
|
+ // 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', 'websockify');
|
|
|
|
+ if ((!host) || (!port)) {
|
|
|
|
+ updateState('failed',
|
|
|
|
+ "Must specify host and port in URL");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ rfb = new RFB({'target': $D('noVNC_canvas'),
|
|
|
|
+ '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);
|
|
|
|
+ };
|
|
|
|
+ </script>
|
|
|
|
+
|
|
|
|
+ </body>
|
|
|
|
+</html>
|
|
|
|
+
|