1

I came across a project Apache-Guacamole which helps you connect to remote computers through a web browser. I am trying to integrate it to a spring-boot application, but unable to do so.

The documentation is quite complex to understand. So, can anybody provides a way to implement it. I have been trying this from a week, but unable to finish it.

I found one servlet class online, but it is not working.

Any help will be appreciated. Please guide me.

Thank you.

Virat
  • 551
  • 4
  • 9
  • 23

2 Answers2

2

It is actually quite simple. First implement the example servlet from the official manual

Then annotate the servlet class as @RestController (@Controller might work too) and then override the handler method and set the url mapping.

@Override
@RequestMapping(path = "tunnel", method = { RequestMethod.POST, RequestMethod.GET })
protected void handleTunnelRequest(HttpServletRequest request,
        HttpServletResponse response) throws ServletException {
    super.handleTunnelRequest(request, response);
}

Then you can use the endpoint as described in the manual

cacaocow
  • 21
  • 3
0

In addition to what cacaocow posted, if you are using a newer version of spring boot, you may need to include the following in your application properties file.

spring.jackson.serialization.FAIL_ON_EMPTY_BEANS=false

server.tomcat.relaxed-query-chars={,},[,]

The first prevents the crash from org.apache.guacamole.net.SimpleGuacamoleTunnel["socket"]-> org.apache.guacamole.protocol.ConfiguredGuacamoleSocket["reader"] and the second allows the guacamole client to send query messages with {} and [] characters that are no longer supported by newer webservers.

It is actually quite simple. First implement the example servlet from the official manual Then annotate the servlet class as @RestController (@Controller might work too) and then >override the handler method and set the url mapping.

@Override
@RequestMapping(path = "tunnel", method = { RequestMethod.POST, RequestMethod.GET })
protected void handleTunnelRequest(HttpServletRequest request,
       HttpServletResponse response) throws ServletException {
   super.handleTunnelRequest(request, response);
}

Then you can use the endpoint as described in the manual