main
Last change
on this file was
42bd667,
checked in by David Fuertes <dfuertes@…>, 4 years ago
|
Historial Limpio
|
-
Property mode set to
100644
|
File size:
1.7 KB
|
Line | |
---|
1 | <!DOCTYPE HTML> |
---|
2 | <html> |
---|
3 | |
---|
4 | <head> |
---|
5 | <title>Remote PC</title> |
---|
6 | </head> |
---|
7 | |
---|
8 | <body> |
---|
9 | <title>Remote PC</title> |
---|
10 | <!-- Guacamole --> |
---|
11 | <script type="text/javascript" |
---|
12 | src="guacamole-common-js/all.min.js"></script> |
---|
13 | |
---|
14 | <!-- Display --> |
---|
15 | <div id="display"></div> |
---|
16 | |
---|
17 | <!-- Init --> |
---|
18 | <script type="text/javascript"> /* <![CDATA[ */ |
---|
19 | |
---|
20 | // Get display div from document |
---|
21 | var display = document.getElementById("display"); |
---|
22 | |
---|
23 | // Instantiate client, using an HTTP tunnel for communications. |
---|
24 | var guac = new Guacamole.Client( |
---|
25 | new Guacamole.WebSocketTunnel("tunnel-websocket") |
---|
26 | ); |
---|
27 | |
---|
28 | |
---|
29 | // Add client to display div |
---|
30 | display.appendChild(guac.getDisplay().getElement()); |
---|
31 | |
---|
32 | |
---|
33 | // Error handler |
---|
34 | guac.onerror = function(error) { |
---|
35 | alert(error); |
---|
36 | }; |
---|
37 | |
---|
38 | |
---|
39 | // Connect |
---|
40 | guac.connect(); |
---|
41 | |
---|
42 | // Disconnect on close |
---|
43 | window.onunload = function() { |
---|
44 | guac.disconnect(); |
---|
45 | } |
---|
46 | |
---|
47 | |
---|
48 | // Mouse |
---|
49 | var mouse = new Guacamole.Mouse(guac.getDisplay().getElement()); |
---|
50 | |
---|
51 | mouse.onmousedown = |
---|
52 | mouse.onmouseup = |
---|
53 | mouse.onmousemove = function(mouseState) { |
---|
54 | guac.sendMouseState(mouseState); |
---|
55 | }; |
---|
56 | |
---|
57 | // Keyboard |
---|
58 | var keyboard = new Guacamole.Keyboard(document); |
---|
59 | |
---|
60 | keyboard.onkeydown = function (keysym) { |
---|
61 | guac.sendKeyEvent(1, keysym); |
---|
62 | }; |
---|
63 | |
---|
64 | keyboard.onkeyup = function (keysym) { |
---|
65 | guac.sendKeyEvent(0, keysym); |
---|
66 | }; |
---|
67 | |
---|
68 | /* ]]> */</script> |
---|
69 | |
---|
70 | </body> |
---|
71 | |
---|
72 | </html> |
---|
Note: See
TracBrowser
for help on using the repository browser.