Thursday, February 5, 2015

JavaFX webview set Proxy

The problem was cause by a bugfix I did earlier. When working with proxies in java this post is quite helpful. In the end it recommends setting ProxySelector.setDefault(null); to avoid issue with sockets and proxies.
However, this made setting the proxy via
System.setProperty("http.proxyHost","proxy.esrf.fr");
System.setProperty("http.proxyPort","3128");
impossible. Actually, it wasn't possible to set any proxy at all except by passing a Proxy object to URL.openConnection(Proxy p);
So instead of setting the default ProxySelector to null, I recommend setting
ProxySelector.setDefault(ProxySelector.getDefault());

No comments:

Post a Comment