Is there an easy way to set the proxy host and port in Jersey 1?

In particular, the version I'm using is Jersey 1.19 . This is currently what I am doing:

 Client client = Client.create(); client.getProperties().put(ApacheHttpClientConfig.PROPERTY_PROXY_URI, "myhost:myport"); 

However, this did not work for me, since I got an UnknownHostException :

 com.sun.jersey.api.client.ClientHandlerException: java.net.UnknownHostException: 

Help is much appreciated.

+5
source share

Source: https://habr.com/ru/post/1259885/


All Articles