forked from mirror/serenity
Fix cn route
This commit is contained in:
parent
bfac628bbe
commit
c5eab36093
@ -171,7 +171,6 @@ func (t *Template) renderDNS(metadata M.Metadata, options *option.Options) error
|
||||
options.DNS.Rules = append(options.DNS.Rules, t.PreDNSRules...)
|
||||
if len(t.CustomDNSRules) == 0 {
|
||||
if !t.DisableTrafficBypass {
|
||||
|
||||
options.DNS.Rules = append(options.DNS.Rules, option.DNSRule{
|
||||
Type: C.RuleTypeDefault,
|
||||
DefaultOptions: option.DefaultDNSRule{
|
||||
@ -210,7 +209,7 @@ func (t *Template) renderDNS(metadata M.Metadata, options *option.Options) error
|
||||
Type: C.RuleTypeDefault,
|
||||
DefaultOptions: option.DefaultDNSRule{
|
||||
RawDefaultDNSRule: option.RawDefaultDNSRule{
|
||||
RuleSet: []string{"geosite-geolocation-!cn"},
|
||||
RuleSet: []string{"geoip-cn"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -218,7 +217,8 @@ func (t *Template) renderDNS(metadata M.Metadata, options *option.Options) error
|
||||
Type: C.RuleTypeDefault,
|
||||
DefaultOptions: option.DefaultDNSRule{
|
||||
RawDefaultDNSRule: option.RawDefaultDNSRule{
|
||||
RuleSet: []string{"geoip-cn"},
|
||||
RuleSet: []string{"geosite-geolocation-!cn"},
|
||||
Invert: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -172,7 +172,39 @@ func (t *Template) renderRoute(metadata M.Metadata, options *option.Options) err
|
||||
Type: C.RuleTypeDefault,
|
||||
DefaultOptions: option.DefaultRule{
|
||||
RawDefaultRule: option.RawDefaultRule{
|
||||
RuleSet: []string{"geoip-cn", "geosite-geolocation-cn"},
|
||||
RuleSet: []string{"geosite-geolocation-cn"},
|
||||
},
|
||||
RuleAction: option.RuleAction{
|
||||
Action: C.RuleActionTypeRoute,
|
||||
RouteOptions: option.RouteActionOptions{
|
||||
Outbound: directTag,
|
||||
},
|
||||
},
|
||||
},
|
||||
}, option.Rule{
|
||||
Type: C.RuleTypeLogical,
|
||||
LogicalOptions: option.LogicalRule{
|
||||
RawLogicalRule: option.RawLogicalRule{
|
||||
Mode: C.LogicalTypeAnd,
|
||||
Rules: []option.Rule{
|
||||
{
|
||||
Type: C.RuleTypeDefault,
|
||||
DefaultOptions: option.DefaultRule{
|
||||
RawDefaultRule: option.RawDefaultRule{
|
||||
RuleSet: []string{"geoip-cn"},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Type: C.RuleTypeDefault,
|
||||
DefaultOptions: option.DefaultRule{
|
||||
RawDefaultRule: option.RawDefaultRule{
|
||||
RuleSet: []string{"geosite-geolocation-!cn"},
|
||||
Invert: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
RuleAction: option.RuleAction{
|
||||
Action: C.RuleActionTypeRoute,
|
||||
|
Loading…
Reference in New Issue
Block a user