Skip to content
Discussion options

You must be logged in to vote

Got already has a solution for this. You can use the dnsLookupIpVersion option to force IPv4:

await got('http://localhost:3000', {
	dnsLookupIpVersion: 4
});

Alternatively, use 127.0.0.1 directly instead of localhost.

The autoSelectFamily option could be added as a pass-through to Node.js, but given the existing workarounds, I don't think it's necessary.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sindresorhus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants