@Override
protected HttpHost determineProxy(final HttpHost target,
final HttpRequest request,
final HttpContext context) throws HttpException {
Configuration config = MfClientHttpRequestFactoryImpl.getCurrentConfiguration();
if (config == null) {
return null;
}
final URI uri;
try {
uri = new URI(request.getRequestLine().getUri());
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
HttpMethod method = HttpMethod.valueOf(request.getRequestLine().getMethod());
final List<HttpProxy> proxies = config.getProxies();
for (HttpProxy proxy : proxies) {
try {
if (proxy.matches(MatchInfo.fromUri(uri, method))) {
return proxy.getHttpHost();
}