hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Motes <davidmo...@gmail.com>
Subject Re: Need help with ProxySelectorRoutePlanner
Date Tue, 11 Jan 2011 16:09:12 GMT
Some progress, you need to add this to use the system proxies.

System.setProperty("java.net.useSystemProxies", "true");

I have a jlabel that contains an icon loaded from a web server and it
now goes through the proxy.
It gets the proxy info from the Internet Options configured in browser.

HttpClient seems to hang up when I do a Get.  Getting this line only
in the wire trace.
Which looks correct as 192.168.1.144:8000 is the proxy.

2011/01/11 10:58:34:296 EST [DEBUG] SingleClientConnManager - Get
connection for route
HttpRoute[{}->http://192.168.1.144:8000->http://www2.mytest.com]

Am going to mess with this later today, will let you know if I
discover anything...
Thanks


On Tue, Jan 11, 2011 at 8:21 AM, Oleg Kalnichevski <olegk@apache.org> wrote:
> On Mon, 2011-01-10 at 18:00 -0500, David Motes wrote:
>> I seem to be missing something. I am trying to use this sample code
>> from the doc to access a proxy without
>> configuring the proxy parms.
>>
>> One can also instruct HttpClient to use standard JRE proxy selector to
>> obtain proxy information:
>> DefaultHttpClient httpclient = new DefaultHttpClient();
>> ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
>>         httpclient.getConnectionManager().getSchemeRegistry(),
>>         ProxySelector.getDefault());
>> httpclient.setRoutePlanner(routePlanner);
>>
>> My program is not an applet, it will eventually be a web start application.
>> The url is https.
>> I set up the default browser to use a proxy, then set the Java config
>> to use a proxy and my application will
>> not use the proxy.
>> Is there some other configuration or some other code that I need? Is
>> it the SSL?
>> Do I not understand what ProxySelectorRoutePlanner does?
>>
>> Thanks.
>>
>
> David
>
> My understanding is that ProxySelector gets pre-configured by the Applet
> container based on the settings of the host browser, but one still needs
> to configure ProxySelector using system properties when running in a
> normal JSE environment.
>
> http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
>
> Hope this helps
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message