Skip to content

Commit

Permalink
Fix cn route
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Nov 29, 2024
1 parent bfac628 commit 4dd4cec
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
1 change: 0 additions & 1 deletion template/render_dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
34 changes: 33 additions & 1 deletion template/render_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4dd4cec

Please sign in to comment.