Skip to content
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

Address4 support for isLookback() #54

Open
elyscape opened this issue Jul 24, 2017 · 2 comments
Open

Address4 support for isLookback() #54

elyscape opened this issue Jul 24, 2017 · 2 comments

Comments

@elyscape
Copy link

While it is a common misconception that 127.0.0.1 is the only IPv4 loopback address, the entire 127.0.0.0/8 block is considered loopback. It would be nice if Address4 provided an isLoopback() method as syntactic sugar for address.isInSubnet(new Address4('127.0.0.0/8')).

@beaugunderson
Copy link
Owner

@elyscape happy to merge a PR for this one if you'd like to add it! (i will implement it eventually if you don't but it could be a few days); you'd add it to lib/ipv4.js and a corresponding test in test/functionality-v4-test.js

@elyscape
Copy link
Author

An alternate option would be to implement it similarly to how it's implemented in Address6, by implementing address types. IPv4 has link-local, private, and multicast addresses, and it might be a good idea to provide detection of those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants