Skip to content

Commit

Permalink
Add route address set
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Jun 16, 2024
1 parent a56df2a commit 6a68e63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions template/filter/filter_1100.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ func init() {
}

func filter1100(metadata metadata.Metadata, options *option.Options) {
if metadata.Version == nil || metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.10.0-alpha.2")) {
if metadata.Version == nil || metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.10.0-alpha.13")) {
return
}
newInbounds := make([]option.Inbound, 0, len(options.Inbounds))
for _, inbound := range options.Inbounds {
if inbound.Type == C.TypeTun && inbound.TunOptions.AutoRedirect {
if inbound.Type == C.TypeTun {
inbound.TunOptions.AutoRedirect = false
inbound.TunOptions.RouteAddressSet = nil
inbound.TunOptions.RouteExcludeAddressSet = nil
}
newInbounds = append(newInbounds, inbound)
}
Expand Down
3 changes: 3 additions & 0 deletions template/render_inbounds.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ func (t *Template) renderInbounds(metadata M.Metadata, options *option.Options)
}
if autoRedirect {
tunInbound.TunOptions.AutoRedirect = true
if !t.DisableTrafficBypass {
tunInbound.TunOptions.RouteExcludeAddressSet = []string{"geoip-cn"}
}
}
if t.EnableFakeIP {
tunInbound.TunOptions.InboundOptions.DomainStrategy = domainStrategy
Expand Down

0 comments on commit 6a68e63

Please sign in to comment.