Open flyinmind opened 3 years ago
IMHO, this functionality is better kept outside reqwest, since there are so many different ways to do DNS resolution.
However, you could write a fairly simple wrapper to do what you want:
parse the url with url::Url, extract the host, dns lookup host using your favorite dns client library, set url host to IP, use url.to_string() to create reqwest.Request, and add a Host header with the original hostname
looks like dup of #1007
Yes, they are same. Is there a way?
OkHttp or ApacheHttpClient in java can support a Dns resolver customized. In actix-web-client, can set address in ClientRequest to realize the feature. It is useful specially in micro-service or client-based-balance. Can reqwest support a Dns resolver or other function to realize it? Thanks a lot!