javajettygoogle-wave

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. It works as far as us loading the site, registering, logging in, creating and participating in waves. But I can't seem to get external gadgets, like http://everybodywave.appspot.com/gadget/image/gadget.xml, to load. 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.

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. 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. 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. 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)

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? Do I need to set some Jetty property too?


Solution

  • It looks like the jetty ProxyServlet uses the jetty async http client under the covers which has a setProxy(Address) for setting proxies. ProxyServlet also contains an extension point to perform custom configuration of the enclosed HttpClient, but this is not being exposed by the Wave platform. I'd say you have two options: