Open DCsunset opened 1 month ago
There is a special support for TCP with hostnames (it supports trying multiple resolved addresses and choosing the one that works). This support appeared relatively late in Websocat history.
What shall udp:example.com
do if it resolves to e.g. 1.2.3.4
and [5678::9]
?
That's a good point. I think one approach is to use a random address (usually both should work). Another approach is to add udp4
and udp6
as socat
does.
What if multiple addresses from the same family is returned?
Shall the address be resolved once or periodically refreshed?
For the first question, I think using the first one should be good for most cases and is easy to implement. (If any address doesn't work, it should be the responsibility of the server instead of this app)
For the second question, I think either approach is good enough for most apps to work.
When using
udp:
with a host name, it throws an error:However,
tcp
works as expected: