fix(web): use 127.0.0.1 loopback address when checking if a port is open (#17192)

This commit is contained in:
Jack Hsu 2023-05-24 15:28:48 -04:00 committed by GitHub
parent 05f114fef5
commit fe4682a0e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,9 @@ export function waitForPortOpen(
}
});
client.connect({ port, host: options.host ?? 'localhost' });
// Node will use IPv6 if it is available, but this can cause issues if the server is only listening on IPv4.
// Hard-coding to look on 127.0.0.1 to avoid using the IPv6 loopback address "::1".
client.connect({ port, host: options.host ?? '127.0.0.1' });
};
checkPort();