I use this code to get the system proxies in Java:
System.setProperty("java.net.useSystemProxies", "true");
List<Proxy> list = null;
try
{
list = ProxySelector.getDefault().select(new URI("http://google.com"));
}
catch (final URISyntaxException e)
{
e.printStackTrace();
}
But "list" only contains DIRECT
, but not the settings I set in Internet Explorer. The strange thing is, that in an earlier version of our software the exact same code returns the correct list of system proxies.
Does anyone know what could possibly make it impossible for the code to work properly?
I added some native libraries, that is the only thing I could think of. But still I have no idea how this could affect this code. I tested the same code in a little test app, within the same eclipse environment etc. and it works. But when I debug into the same code within my application the list only contains DIRECT
.
Any ideas?