mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
92 lines
2.8 KiB
HTML
92 lines
2.8 KiB
HTML
<!DOCTYPE HTML>
|
|
<!--
|
|
Copyright (C) 2015 Glyptodon LLC
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
THE SOFTWARE.
|
|
-->
|
|
|
|
<html>
|
|
|
|
<head>
|
|
<link rel="stylesheet" type="text/css" href="guacamole.css"/>
|
|
<title>Guacamole (EXAMPLE)</title>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<!-- Display -->
|
|
<div id="display"></div>
|
|
|
|
<!-- Guacamole JavaScript API -->
|
|
<script type="text/javascript"
|
|
src="guacamole-common-js/all.min.js"></script>
|
|
|
|
<!-- Init -->
|
|
<script type="text/javascript"> /* <![CDATA[ */
|
|
|
|
// Get display div from document
|
|
var display = document.getElementById("display");
|
|
|
|
// Instantiate client, using an HTTP tunnel for communications.
|
|
var guac = new Guacamole.Client(
|
|
new Guacamole.HTTPTunnel("tunnel")
|
|
);
|
|
|
|
// Add client to display div
|
|
display.appendChild(guac.getDisplay());
|
|
|
|
// Error handler
|
|
guac.onerror = function(error) {
|
|
alert(error);
|
|
};
|
|
|
|
// Connect
|
|
guac.connect();
|
|
|
|
// Disconnect on close
|
|
window.onunload = function() {
|
|
guac.disconnect();
|
|
}
|
|
|
|
// Mouse
|
|
var mouse = new Guacamole.Mouse(guac.getDisplay());
|
|
|
|
mouse.onmousedown =
|
|
mouse.onmouseup =
|
|
mouse.onmousemove = function(mouseState) {
|
|
guac.sendMouseState(mouseState);
|
|
};
|
|
|
|
// Keyboard
|
|
var keyboard = new Guacamole.Keyboard(document);
|
|
|
|
keyboard.onkeydown = function (keysym) {
|
|
guac.sendKeyEvent(1, keysym);
|
|
};
|
|
|
|
keyboard.onkeyup = function (keysym) {
|
|
guac.sendKeyEvent(0, keysym);
|
|
};
|
|
|
|
/* ]]> */ </script>
|
|
|
|
</body>
|
|
|
|
</html>
|