feat: add IP-ASN rule

This commit is contained in:
xishang0128
2024-03-12 03:14:25 +08:00
parent 7ad37ca0e3
commit 44d8a14629
15 changed files with 248 additions and 33 deletions

View File

@@ -24,7 +24,7 @@ var geoIPMatcher *router.GeoIPMatcher
func (gf *geoipFilter) Match(ip netip.Addr) bool {
if !C.GeodataMode {
codes := mmdb.Instance().LookupCode(ip.AsSlice())
codes := mmdb.IPInstance().LookupCode(ip.AsSlice())
for _, code := range codes {
if !strings.EqualFold(code, gf.code) && !ip.IsPrivate() {
return true