Chore: aggregate mmdb (#474)
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
package dns
|
||||
|
||||
import "net"
|
||||
import (
|
||||
"net"
|
||||
|
||||
"github.com/Dreamacro/clash/component/mmdb"
|
||||
)
|
||||
|
||||
type fallbackFilter interface {
|
||||
Match(net.IP) bool
|
||||
@ -9,11 +13,7 @@ type fallbackFilter interface {
|
||||
type geoipFilter struct{}
|
||||
|
||||
func (gf *geoipFilter) Match(ip net.IP) bool {
|
||||
if mmdb == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
record, _ := mmdb.Country(ip)
|
||||
record, _ := mmdb.Instance().Country(ip)
|
||||
return record.Country.IsoCode == "CN" || record.Country.IsoCode == ""
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user