Default to IPv4 localhost for Node 17 compatibility #214
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #209. Without this adbkit is not usable with Node 17 (or any other future Node versions, presumably).
When testing locally, on my machine with Node 17.0.1 the tests today fail with:
This happens because Node 17 defaults to IPv6 and ADB's local server never listens for IPv6 connections, as far as I can tell.
This does change the default, which could affect anybody where localhost doesn't resolve to
127.0.0.1
, in theory, but in practice I don't think this will cause issues - anybody who resolveslocalhost
to a different IP address has a very unusual configuration and likely has other networking issues already.Interestingly, I had to add the
host
option from scratch for this PR, even though it's already documented as existing. I guess it got lost in the TypeScript rewrite? Pretty clear from the source that it didn't work until now.