admin管理员组文章数量:1315229
I am trying to configure my spring restclient in a way that if hostname has "internal" in its name then do not go via proxy and if it is something else then go via proxy. We are currently achieving it using two different restclients one having proxy configuration and one do not have.
HttpHost proxy = new HttpHost("someproxy", 8080);
DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxy);
CloseableHttpClient httpclient = HttpClients.custom()
.setRoutePlanner(routePlanner)
.build();
Can we achieve it in the same restclient?
本文标签:
版权声明:本文标题:java - Is there a way to configure proxy based on hostname in PoolingHttpClientConnectionManager httpclient5 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741981751a2408438.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论