You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I run this on the remote machine which I want to access using - VNC
#!/usr/bin/env node
constGuacamoleLite=require('guacamole-lite');constwebsocketOptions={port: 8080// we will accept connections to this port};constguacdOptions={port: 4822// port of guacd};constclientOptions={log: {level: 'VERBOSE'},crypt: {cypher: 'AES-256-CBC',key: 'MySuperSecretKeyForParamsToken12'}};constguacServer=newGuacamoleLite(websocketOptions,guacdOptions,clientOptions);
And then
I try to connect to it using below code
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><title>Page Title</title><metaname="viewport" content="width=device-width,initial-scale=1"><linkrel="stylesheet" href=""><style></style><!-- Guacamole --><scripttype="text/javascript"
src="https://unpkg.com/browse/[email protected]/dist/guacamole-common.js"></script></head><body><!-- Display --><divid="display"></div><!-- Init --><scripttype="text/javascript">/* <![CDATA[ */// Get display div from documentvardisplay=document.getElementById("display");// Instantiate client, using an HTTP tunnel for communications.varguac=newGuacamole.Client(newGuacamole.WebSocketTunnel("ws://<PUBLIC_IP_OF_MACHINE>:8080"));// Add client to display divdisplay.appendChild(guac.getDisplay().getElement());// Error handlerguac.onerror=function(error){console.log("Error :: ",error);alert(error);};// Connectguac.connect('token=<generated_token>');// Disconnect on closewindow.onunload=function(){guac.disconnect();}/* ]]> */</script><!-- Init --><scripttype="text/javascript">/* <![CDATA[ */// Mousevarmouse=newGuacamole.Mouse(guac.getDisplay().getElement());mouse.onmousedown=mouse.onmouseup=mouse.onmousemove=function(mouseState){guac.sendMouseState(mouseState);};// Keyboardvarkeyboard=newGuacamole.Keyboard(document);keyboard.onkeydown=function(keysym){guac.sendKeyEvent(1,keysym);};keyboard.onkeyup=function(keysym){guac.sendKeyEvent(0,keysym);};/* ]]> */</script></body></html>
In above code - <PUBLIC_IP_OF_MACHINE> - this is public IP of the machine which I want to access using VNC
and - <generated_token> - this is a token generated using the below script ---
Hi,
I have the following code --
I run this on the remote machine which I want to access using - VNC
And then
I try to connect to it using below code
In above code - <PUBLIC_IP_OF_MACHINE> - this is public IP of the machine which I want to access using VNC
and - <generated_token> - this is a token generated using the below script ---
It works when -- above index.html file is served over http.
When I serve the above - index.html file over https and modify
this
as
I get the below error in Browser console -
wss -- guacamole-common.js:13108 WebSocket connection to 'wss://<PUBLIC_IP_OF_MACHINE>:8080/?token=<token>' failed: [email protected]:[email protected]:3336(anonymous)@?userId=9had87:50
Any help is much appreciated.
The text was updated successfully, but these errors were encountered: