-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more control over how the connection and resolution is established #2418
Comments
I think you're right, there isn't really a way to pick that generally. You can specify to bind to a certain local address, and its IP version will force that decision. Additionally, "dual stack" is assumed unless binding disables it, or you disable the "happy eyeballs" timeout. |
Regarding DNS, could you propose more? It's possible to provide your own resolver, which I assume could do exactly what you want. If proposing to add something specifically to |
Exposing more of its bit would certainly help with building custom resolvers. If not that - a simple setting to request an A or AAAA record (or no preference) would be just enough for my needs. This can be achieved via setting |
Exactly which bits is what I'm asking :) Note that |
It contains a thread pool, right? Exposing that would be useful. If it was exposed in such a way that I can swap out the |
It utilizes Tokio's "blocking" threads, via |
Indeed, just checked - I think it's trivial to implement. There's a lot of boilerplate with regard to futures though. |
One of the notable things is the lack of |
Implemented a custom resolver that fits my needs: https://github.com/MOZGIII/hyper-system-resolver I've also discovered that it's possible to perform name resolution using system resolvers in the async fashion on Linux and Windows. Would be interesting to dig deeper into those. |
I believe Does hyper intend to support the HTTPS RR? If so that might be an opportunity to make the interface less tied to single-shot name to A and AAAA resolution. |
I need to have more control over whether the IPv4/IPv6 is used.
There are two parts to this.
Part 1: DNS
I'd like to have control over what IP protocol version is requested during the DNS resolution. This means hinting whether the A/AAAA records are requested during the resolution. The
GaiResolver
relies on thegetaddrinfo
under the hood, which has rich functionality allowing all the necessary flexibility, however, the API currently doesn't expose any of that. I know this might be due to the cross-platform compatibility needs, but I wonder what does it take to land it.Part 2: Explicit IPv4 / IPv6 / Dual-stack sockets use in
HttpConnector
The
HttpConnector
has a lot of logic built-in to support both IPv4 and IPv6 sockets. However, as of right now, there's no way to explicitly make it use only IPv4, IPv6 or dual-stack. Given its internal complexity, I think the best route would be implementing a custom connector. I still wanted to mention it though, because it might be valuable feedback, and would welcome it if this functionality was available in the crate.The text was updated successfully, but these errors were encountered: