Justin Lee has the best answer to this question. First, I was afraid that ProxySelector would return more than one proxy definition, but in fact it only returns one, although the return type is List.
@Override public List<Proxy> select(URI uri) { return Collections.singletonList(selectOneProxy(uri)); } private Proxy selectOneProxy(URI uri) {[...]
Secondly, I think that using a wild custom system setup would be good practice. For ease of use and dynamic proxy configuration. See here for more information on the select(java.net.URI) method select(java.net.URI) .
Oh, by the way, if I were you, I would first see the createConnection(java.net.Url) implementation in HurlStack. There he is:
protected HttpURLConnection createConnection(URL url) throws IOException { HttpURLConnection connection = (HttpURLConnection) url.openConnection();
Check out these comments ...
Andre Luiz Fernandes de Mello May 05 '16 at 16:59 2016-05-05 16:59
source share