users@glassfish.java.net

Problem with http.proxyhost

From: Olivier Liechti <olivier.liechti_at_heig-vd.ch>
Date: Wed, 16 Apr 2008 00:32:00 -0700 (PDT)

Hello,

I have a Java EE application, with a JSF front-end. In a backing bean, I
want to fetch a URL and need the possibility to set the http proxy at the
application level. So, I tried the following:

            System.setProperty("http.proxySet", "true");
            System.setProperty("http.proxyHost", "myproxy.mynetwork.net");
            System.setProperty("http.proxyPort", "8080");

            URI uri = new URI("http", url, null);
            URL serviceUrl = uri.toURL();
            BufferedReader br = new BufferedReader(new
InputStreamReader(serviceUrl.openStream()));

I get a "java.net.ConnectException: Operation timed out" exception. I
sniffed the network traffic with wireshark and observed that the HTTP
request does NOT go through the proxy...

What am I am missing?

Many thanks and best regards,

Olivier
-- 
View this message in context: http://www.nabble.com/Problem-with-http.proxyhost-tp16718017p16718017.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.