ipKeyGenerator(ip, ipv6Subnet=56)
Params:
ip(string) An IPv4 or IPv6 IP addressipv6Subnet(number|false) Subnet mask to apply to IPv6 addresses. Valid range is 1-120, recommend range is 48-64.
false, then IPv6 is also returned
unchanged).
IPv4-mapped IPv6 addresses (the ::ffff:0:0/96 range, commonly seen on
dual-stack servers) are returned as the IPv4 address they contain, whichever
notation they arrive in.
This method is used by the default
keyGenerator to apply the configured
ipv6Subnet, in order to properly rate-limit IPv6
users.
When using a custom keyGenerator that uses the
user’s IP for rate-limiting (even as a fallback), return the result of this
method rather than the IP address itself.