Repository navigation
Support hostname targets in config - #24
Conversation
bit-aloo
left a comment
There was a problem hiding this comment.
Direction makes sense. Some suggestions.
|
I'm not strongly opinionated on this, but while looking at the diff I wondered whether @lucasbalieiro was this something you took into consideration or deliberately avoid? |
|
Are you talking about vectored lookup? like here we iterate on list and then do lookup calls here, so maybe having a vectored lookup might be helpful? |
assuming this question is directed to my earlier comment: no, I was just referring to the logic around I don't have opinions on whether we should have concurrency to resolve hostnames. |
well, this was considered. The code already uses The hand-rolled part is only at the TOML boundary. To my knowledge, std doesn't provide a deserializable type for a "hostname-or-IP + port" value. I could, of course, remove this parsing logic from the TOML layer and simply feed the value to However, there's a trade-off: errors would move from config-load time to runtime. A typo in the address could become indistinguishable from a DNS resolution failure, resulting in less specific and more generic errors. The errors would also tend to be OS-specific, e.g. The For example, with Versus simply passing the string to the Tokio function: Both fail, but only the first tells the user what's actually wrong: they forgot to specify the port. That said, HostPort isn't strictly necessary for the functionality itself. I'd consider it a small usability improvement rather than a hard requirement. I'm not particularly opinionated about keeping it or removing it; the implementation is already there, but I'm happy to simplify it if we feel these extra guardrails aren't worth it. |
6b8745a to
fdc1a35
Compare
fdc1a35 to
4684dd9
Compare
4684dd9 to
4de78ee
Compare
4de78ee to
6e98fce
Compare
closes #14
Target addresses now accept hostnames as well as IP literals. Hostnames are resolved concurrently before the run starts, and IPv4 is preferred when both address families are returned. Malformed addresses still fail during TOML parsing; unresolvable ones are reported per target without stopping the remaining sites, though the CLI exits non-zero at the end.
TargetAddresskeeps IP literals and hostnames distinct, soSocketAddrowns IP parsing and formatting. Resolution errors are summarized in the default output, with the OS resolver detail available under--verbose.The block shows the default output. With
--verbose, the platform-specific resolver line is added undertarget unresolved