Dwolla/node-ipfilter — pull request #5 by GamerGambit (2014-10-30 23:23:44+00:00)
Title: IPv6 integration (and some styling).

Hi all, I have recently starting using ipfilter with NodeJS except its not really that handy for dealing with IPv4 addresses since node handles IPv6, so I took it upon myself to integrate the IPv6 package (https://www.npmjs.org/package/ipv6) into ipfilter. The result is that all ipv4 and 6 IP addresses are automatically handled and translated properly so you dont have to worry about anything.

Aside from various style changes, I also made it so that localhost/loopback is ALWAYS accepted (blocking it is stupid), IPv4 and 6 loopbacks are actually handled different by the IPv6 package for some reason so there is a bit of a hack for that.

Another note-worthy change is the options object that is passed to the ipfilter function. "mode" has been renamed to "deny" and it takes a bool for whether it should deny all or not (again, loopback is exempt from this always).

The end result is (for me at least) nicer looking code, better design (sort of) and you can now mix IPv4 and 6 IP addresses at will in the array that you pass to ipfilter.

I do apologize for the amount of commits, my testing environment is on another computer and I was too lazy to setup proper file sharing.