Skip to content

Instantly share code, notes, and snippets.

@evanlucas
Created February 19, 2016 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evanlucas/09cef3af8e1123797b2c to your computer and use it in GitHub Desktop.
Save evanlucas/09cef3af8e1123797b2c to your computer and use it in GitHub Desktop.
diff --git a/lib/net.js b/lib/net.js
index f75c9b2..8348df4 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -1166,9 +1166,10 @@ function createServerHandle(address, port, addressType, fd) {
// Try binding to ipv6 first
err = handle.bind6('::', port);
if (err) {
+ debug('ipv6 bind error %s', err);
handle.close();
// Fallback to ipv4
- return createServerHandle('0.0.0.0', port);
+ err = handle.bind('0.0.0.0', port);
}
} else if (addressType === 6) {
err = handle.bind6(address, port);
@@ -1178,6 +1179,7 @@ function createServerHandle(address, port, addressType, fd) {
}
if (err) {
+ debug('bind error %s', err);
handle.close();
return err;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment