Skip to content

Commit db07366

Browse files
committed
fix(connect): connect with family 0 instead of family 4
This is a fix for a hard-to-reproduce bug that occurs in certain network setups on Windows 10. In those cases, attempting an IPv6 lookup with a shortname will somehow cause the subsequent IPv4 lookup to also fail, even though it can succeed independently. For some reason, this does NOT happen with family: 0. This really should be fixed in either Node or in Windows itself, but since we cannot create a stable reproducer, we will use this fix short-term while we come up with a more stable solution. Fixes NODE-1747 Fixes NODE-2143
1 parent ea83360 commit db07366

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/core/connection/connect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function connect(options, callback) {
3535

3636
return makeConnection(6, options, (err, ipv6Socket) => {
3737
if (err) {
38-
makeConnection(4, options, (err, ipv4Socket) => {
38+
makeConnection(0, options, (err, ipv4Socket) => {
3939
if (err) {
4040
callback(err, ipv4Socket); // in the error case, `ipv4Socket` is the originating error event name
4141
return;

0 commit comments

Comments
 (0)