reqwest icon indicating copy to clipboard operation
reqwest copied to clipboard

Allow DNS overrides per request

Open Xiretza opened this issue 1 year ago • 1 comments

Currently, DNS overrides can only be configured globally for a client using ClientBuilder::resolve() (#561/#1277), not per-request.

My use case for this is matrix federation requests, which can be delegated to a different host using SRV records. Since this delegation should only affect the network address being connected to, not e.g. the Host header or TLS domain names, hooking the resolver is the most straightforward option, but for correctness and simplicity it would be much better to do this on a per-request basis rather than globally for all requests. Since redirects aren't allowed in this case anyway, even a simple .connect_to(ip_address) method on Request would suffice.

Xiretza avatar Jul 07 '24 20:07 Xiretza