mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-03-06 22:29:55 +00:00
chore: add sourceGeoIP and sourceIPASN to metadata
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package provider
|
||||
|
||||
import (
|
||||
"net/netip"
|
||||
|
||||
C "github.com/metacubex/mihomo/constant"
|
||||
P "github.com/metacubex/mihomo/constant/provider"
|
||||
"github.com/metacubex/mihomo/rules/common"
|
||||
@@ -35,6 +37,18 @@ func (rs *RuleSet) Match(metadata *C.Metadata) (bool, string) {
|
||||
return false, ""
|
||||
}
|
||||
|
||||
// MatchDomain implements C.DomainMatcher
|
||||
func (rs *RuleSet) MatchDomain(domain string) bool {
|
||||
ok, _ := rs.Match(&C.Metadata{Host: domain})
|
||||
return ok
|
||||
}
|
||||
|
||||
// MatchIp implements C.IpMatcher
|
||||
func (rs *RuleSet) MatchIp(ip netip.Addr) bool {
|
||||
ok, _ := rs.Match(&C.Metadata{DstIP: ip})
|
||||
return ok
|
||||
}
|
||||
|
||||
func (rs *RuleSet) Adapter() string {
|
||||
return rs.adapter
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user