You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support to clients to connect to servers by their hostnames.
We'll need to replace the SocketAddr in Args with a String, then first attempt to parse it to an IP address, and if that fails, try looking up the DNS. We can use trust-dns-resolver to look up hostnames.
If parsing out the port is too complicated to do in conjunction with parsing hostnames/IPs, we can move the port into a different argument. In that case, we should adjust the server to take the port separately as well.
If parsing fails, please fail nicely with good error messages!
DNS resolution isn't necessary on servers, as far as I know, because most of the time we'll just be binding to a fixed IP.
The text was updated successfully, but these errors were encountered:
The standard library has a DNS resolver with std::net::ToSocketAddrs which resolves using the host systems resolver.
https://docs.rs/trust-dns-resolver/0.22.0/trust_dns_resolver/
"This is a 100% in process DNS resolver. It does not use the Host OS’ resolver. If what is desired is to use the Host OS’ resolver, generally in the system’s libc, then the std::net::ToSocketAddrs variant over &str should be used."
I think its probably best for us to stick with the standard library unless there is some specific reason to resolve things differently than the host system wants.
Add support to clients to connect to servers by their hostnames.
We'll need to replace the
SocketAddr
inArgs
with aString
, then first attempt to parse it to an IP address, and if that fails, try looking up the DNS. We can use trust-dns-resolver to look up hostnames.If parsing out the port is too complicated to do in conjunction with parsing hostnames/IPs, we can move the port into a different argument. In that case, we should adjust the server to take the port separately as well.
If parsing fails, please fail nicely with good error messages!
DNS resolution isn't necessary on servers, as far as I know, because most of the time we'll just be binding to a fixed IP.
The text was updated successfully, but these errors were encountered: