users@jersey.java.net

[Jersey] Re: How to use a proxy with jersey

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Fri, 27 May 2011 21:35:13 +0200

Hello,

not with standard jersey client (I guess you are talking about making
request) but you should be able to use apache-http-client integration,
which takes proxy as param in client config, see [1]).

I guess we could support this in some kind of per-request temporary
settings.. you are welcomed to contribute if you want .. or file new
RFE.. ah, actually.. it already exists:
http://java.net/jira/browse/JERSEY-307 (its worth reading - contains
info about setting proxy to http url connection) .. and looks like you
should be able to do what you want by providing your HttpUrlConnection
via HttpUrlConnectionFactory [2], so it is possible to use only jersey
client with some tweaks.

Hope it helps, feel free to ask if you have some other questions.

Regards,
Pavel

[1]
http://jersey.java.net/nonav/apidocs/latest/contribs/jersey-apache-client4/com/sun/jersey/client/apache4/config/ApacheHttpClient4Config.html
[2]
http://jersey.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/client/urlconnection/HttpURLConnectionFactory.html

On 5/26/11 4:19 PM, Sylver wrote:
> Hi guys,
> I have a proxy in my JVM and by default jersey use this one.
> Do you know if it's possible to configure jersey to use another proxy (and
> not the first one) for one particular request ?
>
> Thanks.
>
> Simon.
>
> --
> View this message in context: http://jersey.576304.n2.nabble.com/How-to-use-a-proxy-with-jersey-tp6407186p6407186.html
> Sent from the Jersey mailing list archive at Nabble.com.
>