-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http.request option "family: 6" doesn't enable request over IPv6 #6440
Comments
Confirmed. The bug is in diff --git a/lib/_http_agent.js b/lib/_http_agent.js
index fd74daa..3f3d148 100644
--- a/lib/_http_agent.js
+++ b/lib/_http_agent.js
@@ -102,6 +102,10 @@ Agent.prototype.getName = function(options) {
if (options.localAddress)
name += options.localAddress;
+ name += ':';
+ if (options.family === 4 || options.family === 6)
+ name += options.family;
+
return name;
};
diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js
index 029d9ac..d42f855 100644
--- a/lib/_tls_wrap.js
+++ b/lib/_tls_wrap.js
@@ -1021,6 +1021,7 @@ exports.connect = function(/* [port, host], options, cb */) {
connect_opt = {
port: options.port,
host: options.host,
+ family: options.family,
localAddress: options.localAddress
};
} |
@bnoordhuis would you mind if I make a PR to resolve this issue based on your comment? |
I will but I haven't had time yet to write a robust regression test. |
Respect the `{ family: 6 }` address family property when connecting to a remote peer over TLS. Fixes: nodejs#4139 Fixes: nodejs#6440 PR-URL: nodejs#6654 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Respect the `{ family: 6 }` address family property when connecting to a remote peer over TLS. Fixes: nodejs#4139 Fixes: nodejs#6440 PR-URL: nodejs#6654 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Do you have plans to fix this in v4.x? |
#6654 is tagged lts-watch-v4.x. It will make its way into a LTS release eventually. |
I've just backported #6654 to LTS staging. it should be in the next release |
Thank you! |
Seems like
family
option does nothing with actual DNS resolve to ipv6.Problem is internal server should only use ipv6. So, instead of
i should write
The text was updated successfully, but these errors were encountered: