Resolve DNS portions of WebTransport addresses before dialing
Chrome disallows multiple cancelled WebTransport requests to the same host to prevent port scanning. Penalty counts are stored internally in a map with string keys - the keys are the IP address being dialled.
If a multiaddr has a domain name, it must be resolved before it can be dialled, otherwise the IP address used in Chrome's map is an empty string.
If the dial is cancelled before the DNS name is resolved, the penalty is applied to the empty string key. This means dials to all multiaddrs with a DNS component are penalised if one dial to a multiaddr with a DNS component is cancelled before the DNS name is resolved.
If libp2p is running in Chrome, and it is dialing a WebTransport address, we should use the internal DNS component to resolve the DNS name to an IP address before dialling, this way if the dial is aborted by the user or times out, all DNS-based WebTransport multiaddrs will not be penalised.
@achingbrain can i work on this issue?
Yes, please open a PR with tests.
Yes, please open a PR with tests.
Ok I will get on it ASAP
@achingbrain can i work on this issue?
@achingbrain can you please review the pr i have raised for this issue? Let me know if any changes needed.