-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix(lib): use ipaddr.js
instead of ip
for support IPv6
#3
Conversation
- Fix to handle IPv6 address like IPv4-mapped IPv6 addresses
4674f7c
to
d704fc1
Compare
} | ||
} | ||
// TODO: rename option name | ||
if (!options.allowPrivateIPAddress && range !== "unicast") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that allowPrivateIPAddress
option name is invalid.
allowReservedIPAddress
is correct.
// TODO: Travis CI does not support IPv6 | ||
// https://docs.travis-ci.com/user/reference/overview/ | ||
// https://github.com/travis-ci/travis-ci/issues/8891 | ||
(IS_TRAVIS ? it.skip : it)("IPv6: should not request because Socket is closed", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Travis CI does not support IPv6...
We need to other CI servier that support IPv6 network...
In locally, These tests are passed.
ipaddr.js
instead of ip
for IPv6 supporting
ipaddr.js
instead of ip
for IPv6 supportingipaddr.js
instead of ip
for support IPv6
ipaddr.js
instead of ip
for support IPv6ipaddr.js
instead of ip
for support IPv6
https://github.com/indutny/node-ip has not defined IPv4-mapped IPv6 addresses like
[::ffff:127.0.0.1]
.Swith to use ipaddr.js for parsing IPv6 address correctly.
ipaddr.js has
SpecialRanges
that is defined RFC IP Address range that include IPv4-mapped IPv6 addresses.https://github.com/whitequark/ipaddr.js/blob/3ade7dbfa1d9713f0aabe002c9a0718c4cc6cb5e/lib/ipaddr.js#L506
Changes
fix #2