I have a scraper that loops indefinitely, and I want to change the proxy on the client in case there is something wrong like an IP Ban (on 403 status code) or if I just want to change the proxy after each loop to avoid the bans completely.
The problem with this, specially the later case, is that eventually the program crashes when it reaches the maximum connections allowed (java.net.SocketException: No buffer space available (maximum connections reached?)).
Is there a way to change the HTTP Client's proxy without building a new one?