lua-resty-ipmatcher

High performance match IP address for OpenResty Lua.

$ luarocks install lua-resty-ipmatcher

-- IPv4, IPv6 and CIDR

local ipmatcher = require("resty.ipmatcher")
local ip = ipmatcher.new({
"127.0.0.1",
"192.168.0.0/16",
"::1",
"fe80::/32",
})

ngx.say(ip.match("127.0.0.1"))
ngx.say(ip.match("192.168.1.100"))
ngx.say(ip.match("::1"))
ngx.say(ip.match("fe80::1"))

Versions

0.6.1-03 years ago828,540 downloads
0.6-04 years ago285,893 downloads
0.5-04 years ago329 downloads
0.4-04 years ago3,214 downloads
0.3-05 years ago1,676 downloads
0.2-05 years ago1,316 downloads

Dependency for

amber-apigw, Apache APISIX, apisix, kong, lua-resty-expr, lua-resty-radixtree, lua-resty-radixtree, magic-apigw

Manifests