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?