简体   繁体   English

在 Spring Boot 应用程序中集成 Apache guacamole

[英]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.我遇到了一个Apache-Guacamole项目,它可以帮助您通过 Web 浏览器连接到remote computers I am trying to integrate it to a spring-boot application , but unable to do so.我正在尝试将其集成到spring-boot application ,但无法这样做。

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.我在网上找到了一个servlet类,但它不起作用。

Any help will be appreciated.任何帮助将不胜感激。 Please guide me.请指导我。

Thank you.谢谢。

It is actually quite simple.其实很简单。 First implement the example servlet from the official manual首先实现官方手册中的示例servlet

Then annotate the servlet class as @RestController (@Controller might work too) and then override the handler method and set the url mapping.然后将 servlet 类注释为 @RestController(@Controller 也可能工作),然后覆盖处理程序方法并设置 url 映射。

@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.除了 cacacow 发布的内容之外,如果您使用的是较新版本的 spring boot,则可能需要在应用程序属性文件中包含以下内容。

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.第一个防止来自org.apache.guacamole.net.SimpleGuacamoleTunnel["socket"]-> org.apache.guacamole.protocol.ConfiguredGuacamoleSocket["reader"]的崩溃,第二个允许 guacamole 客户端使用{}发送查询消息和[]字符不再受较新的网络服务器支持。

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.首先实现官方手册中的示例 servlet 然后将 servlet 类注释为 @RestController(@Controller 也可能工作),然后 >覆盖处理程序方法并设置 url 映射。

 @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然后您可以按照手册中的描述使用端点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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