Repository navigation
http.request option "family: 6" doesn't enable request over IPv6 #6440
Copy link
Copy link
Closed
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.httpsIssues and PRs related to the https subsystem.Issues and PRs related to the https subsystem.tlsIssues and PRs related to the tls subsystem.Issues and PRs related to the tls subsystem.
Description
Activity
- changed the title
[-]http.request option "family" do nothing[/-][+]http.request option "family: 6" do not enable request over IPv6[/+]on Apr 28, 2016 - changed the title
[-]http.request option "family: 6" do not enable request over IPv6[/-][+]http.request option "family: 6" doesn't enable request over IPv6[/+]on Apr 28, 2016 - addedconfirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.tlsIssues and PRs related to the tls subsystem.Issues and PRs related to the tls subsystem.httpsIssues and PRs related to the https subsystem.Issues and PRs related to the https subsystem.
on Apr 28, 2016 Confirmed. The bug is in
tls.connect()with a second-order bug inhttp.Agent#getName(). This patch should fix it: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.
- added a commit that references this issue
on May 30, 2016 - added a commit that references this issue
on Jun 2, 2016 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.
- added a commit that references this issue
on Jun 29, 2016 I've just backported #6654 to LTS staging. it should be in the next release
Thank you!
- added a commit that references this issue
on Jul 12, 2016
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues and PRs for confirmed bugs.Issues and PRs for confirmed bugs.httpsIssues and PRs related to the https subsystem.Issues and PRs related to the https subsystem.tlsIssues and PRs related to the tls subsystem.Issues and PRs related to the tls subsystem.
Seems like
familyoption does nothing with actual DNS resolve to ipv6.Problem is internal server should only use ipv6. So, instead of
i should write