mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-09 13:48:41 +00:00
Merge branch 'dns' into dns-geo
This commit is contained in:
commit
ee682b17d1
12 changed files with 910 additions and 48 deletions
|
@ -97,6 +97,8 @@ type RouterRule struct {
|
|||
Type string `json:"type"`
|
||||
OutboundTag string `json:"outboundTag"`
|
||||
BalancerTag string `json:"balancerTag"`
|
||||
|
||||
DomainMatcher string `json:"domainMatcher"`
|
||||
}
|
||||
|
||||
func ParseIP(s string) (*geoip.CIDR, error) {
|
||||
|
@ -182,6 +184,10 @@ func parseFieldRule(msg json.RawMessage) (*router.RoutingRule, error) {
|
|||
return nil, newError("neither outboundTag nor balancerTag is specified in routing rule")
|
||||
}
|
||||
|
||||
if rawFieldRule.DomainMatcher != "" {
|
||||
rule.DomainMatcher = rawFieldRule.DomainMatcher
|
||||
}
|
||||
|
||||
if rawFieldRule.Domain != nil {
|
||||
for _, domain := range *rawFieldRule.Domain {
|
||||
rules, err := conf.ParseDomainRule(domain)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue