简体   繁体   中英

Integrating Apache guacamole in spring boot application

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM