seanmonstar / reqwest

An easy and powerful Rust HTTP Client
https://docs.rs/reqwest
Apache License 2.0
9.95k stars 1.13k forks source link

Using HTTPS records (RFC 9460) #2479

Open Nuhvi opened 1 week ago

Nuhvi commented 1 week ago

Overview

In #2413 (closed with PR in http_util) we added the ability to resolve non-zero ports that are used instead of the scheme specific conventional port (80/443).

That is great, however the existing Resolve trait, and the way it is used in http_util is not enough to leverage the usefulness of HTTPS dns records.

Proposal

Usecases

The obvious use case for this beyond just having access to alpn and ech, is that we get:

  1. DNS load balancing, by expecting the implementation to return endpoints (within the same priority) in a random order every time it resolve_https_endpoints() is called.
  2. Failover if one endpoint is not available, we can try to connect to the next endpoint and try that instead.

Next steps

Unfortunately I can't open a PR for this like the previous issue in http_util since it it involves a lot of changes and I will need some mentoring, but also approval of the general plan in case something is missing or unacceptable in it.

Thanks.

Relevant: