简体   繁体   English

Apache公司代理背后的挥手; 或者码头不尊重代理属性

[英]Apache wave behind company proxy; or jetty doesn't respect proxy properties

The high level problem we're having is this.我们遇到的高级问题是这个。 We've got Apache Wave installed and running on our corporate.network.我们已经在 corporate.network 上安装并运行了 Apache Wave。 It works as far as us loading the site, registering, logging in, creating and participating in waves.只要我们加载站点、注册、登录、创建和参与 wave,它就可以正常工作。 But I can't seem to get external gadgets, like http://everybodywave.appspot.com/gadget/image/gadget.xml , to load.但我似乎无法加载外部小工具,例如http://everybodywave.appspot.com/gadget/image/gadget.xml I'm sure it is a proxy issue because I have installed wave outside the corporate.network and I'm able to load gadgets just fine.我确定这是一个代理问题,因为我已经在 corporate.network 之外安装了 wave,并且我能够很好地加载小工具。

Where I'm confused is;我感到困惑的地方是; I've set Apache Wave's JVM's proxy settings in several places, but however they're loading gadgets doesn't work.我已经在几个地方设置了 Apache Wave 的 JVM 代理设置,但是它们正在加载的小工具不起作用。 I've set http.proxyHost and http.proxyPort on the jvm command line, in environment variables JAVA_OPTIONS, JAVA_OPTS, JETTY_OPTIONS, and JETTY_OPTS, and via System.setProperty right before the call to load a gadget.我在 jvm 命令行上设置了 http.proxyHost 和 http.proxyPort,在环境变量 JAVA_OPTIONS、JAVA_OPTS、JETTY_OPTIONS 和 JETTY_OPTS 中,并在调用加载小工具之前通过 System.setProperty 进行了设置。 I've added some code to spit out an external site within Apache Wave's jvm and that works, so the proxy settings are working.我已经添加了一些代码以在 Apache Wave 的 jvm 中吐出一个外部站点并且可以正常工作,因此代理设置可以正常工作。 But gadgets still don't.但是小工具仍然没有。

Here is the closest point to the problem that I can tell: https://svn.apache.org/repos/asf/incubator/wave/trunk/src/org/waveprotocol/box/server/ServerMain.java I'm getting a debug message somewhere below the call to: (line 121; in GadgetProxyServlet)这是我能告诉的最接近问题的点: https://svn.apache.org/repos/asf/incubator/wave/trunk/src/org/waveprotocol/box/server/ServerMain.java我得到调用下方某处的调试消息:(第 121 行;在 GadgetProxyServlet 中)

public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
    proxyServlet.service(req, res);

The debug is:调试是:

[java] 2012-04-06 10:47:25.197:WARN:oejsKwbs.ServerMain$GadgetProxyServlet, annotation=[none]]:java.net.ConnectException: Connection timed out

So maybe my question is.. why isn't a Jetty ProxyServlet.Transparent honoring the jvm's http proxy settings?所以也许我的问题是.. 为什么 Jetty ProxyServlet.Transparent 不支持 jvm 的 http 代理设置? Do I need to set some Jetty property too?我是否也需要设置一些 Jetty 属性?

It looks like the jetty ProxyServlet uses the jetty async http client under the covers which has a setProxy(Address) for setting proxies.看起来 jetty ProxyServlet在幕后使用 jetty async http 客户端,它有一个setProxy(Address)来设置代理。 ProxyServlet also contains an extension point to perform custom configuration of the enclosed HttpClient , but this is not being exposed by the Wave platform. ProxyServlet还包含一个扩展点来执行封闭的HttpClient的自定义配置,但这并没有被 Wave 平台公开。 I'd say you have two options:我会说你有两个选择:

  • Provide a customized version of the jetty ProxyServlet which takes the proxy address from system properties or something and sets it on the wrapped HttpClient .提供自定义版本的码头ProxyServlet ,它从系统属性或其他东西中获取代理地址,并将其设置在包装的HttpClient上。 This is pretty simple and would be the option I'd go with.这非常简单,我会选择 go。
  • At the same time, you can file an enhancement request with the wave team to expose this setting.同时,您可以向 wave 团队提交增强请求以公开此设置。

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

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