Hello,
I am trying to setup Guacamole connection in my Spring Application. I am
almost done, but I keep getting the following error:
*/HTTP tunnel request rejected: No tunnel created/*
This is what I see in browser console:
/POST http://localhost:8080/tunnel?connect/
/Error: 404/
(seems like some connect attribute is empty? But how do I set it and
what should be inside it?)
//
This is how I add the appropiate servlet to my app:
/@Bean//
// public ServletRegistrationBean<GuacamoleConnector>
exampleServletBean() {//
// ServletRegistrationBean<GuacamoleConnector> bean = new
ServletRegistrationBean<>(//
// new GuacamoleConnector(), "/tunnel/*");//
// bean.setLoadOnStartup(1);//
// return bean;//
// }/
This is how I create a tunnel: (almost exact as in Guacamole guide)
/protected GuacamoleTunnel doConnect(HttpServletRequest request, String
IP) throws GuacamoleException {/
/ GuacamoleConfiguration config = new GuacamoleConfiguration();//
// config.setProtocol("vnc");//
// config.setParameter("hostname", IP);//
// config.setParameter("port", "5900");//
// config.setParameter("password", "password");//
////
////
// GuacamoleSocket socket = new ConfiguredGuacamoleSocket(//
// new InetGuacamoleSocket("example.mydomain.com",
4822),//
// config//
// );/
/}////
////
// return new SimpleGuacamoleTunnel(socket);/
Javascript on my page is *exact* as in Guacamole guide. Did not change a
thing.
My docker log:
/guacd[7]: INFO: Creating new client for protocol "vnc"//
//guacd[7]: INFO: Connection ID is "$d0e0811a-1985-4ca8-b37f-c7ca6d67bdad"//
//guacd[618]: INFO: Cursor rendering: local//
//guacd[618]: INFO: User "@5925c83e-e209-46b1-bc77-3e295fe6a3eb"
joined connection "$d0e0811a-1985-4ca8-b37f-c7ca6d67bdad" (1 users now
present)//
//guacd[618]: ERROR: User is not responding./
/guacd[626]: INFO: User "@0b559c19-46b5-48a3-a503-b6cd5c169bd5"
disconnected (0 users remain)
guacd[626]: INFO: Last user of connection
"$06545683-6b86-46f1-893d-e88ea7aea6e8" disconnected
guacd[626]: INFO: Internal VNC client disconnected/
/
/
And finally the code that invokes the connection:
/@GetMapping(value = "/displayer")//
// public String goVNC(@RequestParam String IP, HttpServletRequest
request, Model model)//
// {//
// GuacamoleConnector guacConnect = new GuacamoleConnector();//
// try {//
// GuacamoleTunnel tunnel = guacConnect.doConnect(request,IP);//
// return "displayer";//
// } catch (GuacamoleException e) {//
////
// e.printStackTrace();//
// return "error";//
// }//
////
// }/
(I don't think the HttpServletRequest argument is needed, because
/doConnect()/ method doesn't do anything with it. Servlet is handled by
the bean I showed above)
I would appreciate some clue on the case, as I think I am so close to
making it work!
Michael
P.S. Thank you for help with my previous problem *@Nick Couchman*!
Worked like a charm.