diff --git a/rules/common/geoip.go b/rules/common/geoip.go index ada862d2..72e77045 100644 --- a/rules/common/geoip.go +++ b/rules/common/geoip.go @@ -2,10 +2,10 @@ package common import ( "fmt" - "github.com/Dreamacro/clash/component/geodata" - "github.com/Dreamacro/clash/component/geodata/router" "strings" + "github.com/Dreamacro/clash/component/geodata" + "github.com/Dreamacro/clash/component/geodata/router" "github.com/Dreamacro/clash/component/mmdb" "github.com/Dreamacro/clash/component/resolver" C "github.com/Dreamacro/clash/constant" diff --git a/rules/common/geosite.go b/rules/common/geosite.go index ad3cbae5..e5a0b9f7 100644 --- a/rules/common/geosite.go +++ b/rules/common/geosite.go @@ -2,13 +2,14 @@ package common import ( "fmt" + "github.com/Dreamacro/clash/component/geodata" _ "github.com/Dreamacro/clash/component/geodata/memconservative" "github.com/Dreamacro/clash/component/geodata/router" _ "github.com/Dreamacro/clash/component/geodata/standard" C "github.com/Dreamacro/clash/constant" "github.com/Dreamacro/clash/log" - _ "unsafe" + "github.com/Dreamacro/clash/transport/socks5" ) type GEOSITE struct { @@ -24,6 +25,10 @@ func (gs *GEOSITE) RuleType() C.RuleType { } func (gs *GEOSITE) Match(metadata *C.Metadata) (bool, string) { + if metadata.AddrType() != socks5.AtypDomainName { + return false, "" + } + domain := metadata.Host return gs.matcher.ApplyDomain(domain), gs.adapter }