users@jersey.java.net

Re: [Jersey] How to tell Client API to use HTTP Caching Proxy?

From: Markus KARG <markus.karg_at_gmx.net>
Date: Mon, 25 Aug 2008 18:43:34 +0200

Thank you for that tip. In fact it seems there is no API description how
to use DefaultProxySelector, and writing my own one is a lot of work. So
I just did

System.setProperty("http.proxyHost", "192.168.73.2");
System.setProperty("http.proxyPort", "3128");

It seems to work pretty well.

Has anybody implemented the proposed ProxySelector solution and is
willing to share his code with the newsgroup? :-)

Regards
Markus

Paul Sandoz schrieb:
> Hi Markus,
>
> Since the client API uses HttpURLConnection you can set the ProxySelector:
>
> http://java.sun.com/javase/6/docs/api/java/net/ProxySelector.html
>
> Paul.
>
> On Aug 23, 2008, at 12:15 AM, Markus KARG wrote:
>
>> How can I tell the Client API that I want to use a HTTP Caching Proxy?
>>
>> Currently I am doing:
>>
>> final Client client = Client.create();
>> final WebResource r =
>> client.resource("http://192.168.0.15:8080/JaxRsSample/sample/x.xml");
>>
>> What do I have to do instead to go through the proxy 192.168.73.2:3128 ?
>>
>> Thanks
>> Markus
>>
>> --
>> http://www.xing.com/go/invita/58469
>>
>


-- 
http://www.xing.com/go/invita/58469