uuWAF/rules/geo-block.lua

21 lines
371 B
Lua
Raw Normal View History

2024-03-28 02:02:03 +00:00
--[[
: 访
:
:
2024-09-29 04:09:12 +00:00
: 访
2024-03-28 02:02:03 +00:00
--]]
2024-09-05 07:42:21 +00:00
if waf.contains(waf.ip,":") then
return false
end
2024-03-28 02:02:03 +00:00
local country, province, city = waf.ip2loc(waf.ip)
2024-09-29 04:09:12 +00:00
if country ~= "中国" and city ~= "内网IP" then
return true, "限制非大陆地区访问", true
2024-03-28 02:02:03 +00:00
end
return false