On Fri, 2022-11-04 at 15:49 -0400, Brent Putman wrote:
> Hi,
> 
> I'm working on refactoring our project from 4.5.x to 5.1.x.  Most 
> breaking changes I've figured out.
> 
> I can't however figure what the replacement, if any, is for the 
> RequestConfig localAddress.
> 
> I know one can set this on a per-request basis in HttpClientContext
> via 
> an HttpRoute.
> 
> But is there still a way to configure in a default local address on
> the 
> HttpClient itself?  We had been using the defaultRequestConfig prop
> on 
> the HttpClientBuilder to configure this in before, but localAddress
> has 
> been removed from RequestConfig as of (I think) 5.0, and I don't see 
> any deprecation of it in 4.5.x telling of any replacement.
> 
> Btw, this is for the classic client, not async.
> 
> Any info would be appreciated!
> 
> Thanks,
> Brent

Hi Brent


Having localAddress parameter at the request level was silly. This is a
responsibility of the router planner that has nothing to do with
individual requests. 

Consider extending DefaultRoutePlanner and overriding its
#determineLocalAddress method.

Oleg

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to