arturobernalg opened a new pull request, #430: URL: https://github.com/apache/httpcomponents-client/pull/430
This pull request adds support for proxy failover in the Apache HttpClient. The current implementation of the ProxySelectorRoutePlanner selects a single proxy from the list returned by the java.net.ProxySelector API. If the client can't open a socket to the proxy, other proxies in the list are ignored and the request fails. This is not optimal in network configurations where proxies can go up and down for maintenance. To address this, I have implemented a new FailoverProxySelector class that selects a list of proxies for the given URI by delegating to the next available ProxySelector in the list, until a non-empty proxy list is returned. Once a non-empty proxy list is returned, it becomes the active ProxySelector and is used for subsequent calls to select(). The active ProxySelector is remembered and used for future requests until it fails, at which point the next ProxySelector is used. This implementation is more efficient than the previous solution, which created a disposable socket for every request. It also provides better support for network configurations where proxies can go up and down for maintenance. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org