Questions tagged [proxyselector]

Selects the proxy server to use, if any, when connecting to the network resource referenced by a URL. A proxy selector is a concrete sub-class of this class and is registered by invoking the setDefault method.

7 questions
17
votes
2 answers

Using Proxy with HttpComponentsClientHttpRequestFactory and RestTemplate

Can some one guide me how can I configure HttpComponentsClientHttpRequestFactory to use proxy server. All examples I have seen are using SimpleClientHttpRequestFactory.
4
votes
2 answers

ProxySelector: Different Proxy for Each URL

I'm trying to understand how the ProxySelector class works. My current code looks like this: URI uri = new URI("http://google.com"); proxySelector.select(uri); I understand that when calling proxySelector.select(uri); this is suppose to…
Amit Asaf
  • 155
  • 1
  • 11
4
votes
1 answer

Get system proxy settings doesn't work

I use this code to get the system proxies in Java: System.setProperty("java.net.useSystemProxies", "true"); List list = null; try { list = ProxySelector.getDefault().select(new URI("http://google.com")); } catch…
haferblues
  • 2,155
  • 4
  • 26
  • 39
2
votes
2 answers

Why is ProxySelector returning inconsistent results in Java?

8 months ago I used this stack overflow post to automatically use a proxy server in a Java project. It worked beautifully. Here is the code I came up with at the time: System.setProperty("java.net.useSystemProxies", "true"); List
Jay Askren
  • 10,282
  • 14
  • 53
  • 75
0
votes
0 answers

How to make a portable installation of Java use system proxies?

I need to connect using proxy. It only works when I add -Djava.net.useSystemProxies=true to commandline. The problem is that it works only with installed java on computer, and I also need to run my program on computers with I would say portable java…
0
votes
0 answers

How to Use Proxy in Android App Java Code

I'm relatively new to Android programming and I am developing an app which needs its online traffic to go through a proxy. 1- I came across Proxy and ProxySelector in Android developer website but found very little on how and where exactly in my…
Moe
  • 1
  • 1
0
votes
2 answers

Weblogic setting for proxy

I have a problem with configuration of proxy to connect to WebService on Weblogic 10.3.5. I cannot use System.setProperty() because it has to be per connection aproach. Proxy which I have to use has to have "UserAgent" header. I have tried two…
Adam
  • 884
  • 7
  • 29