forked from mirror/serenity
Add route address set
This commit is contained in:
parent
a56df2aae1
commit
6a68e63049
@ -12,13 +12,15 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func filter1100(metadata metadata.Metadata, options *option.Options) {
|
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
|
return
|
||||||
}
|
}
|
||||||
newInbounds := make([]option.Inbound, 0, len(options.Inbounds))
|
newInbounds := make([]option.Inbound, 0, len(options.Inbounds))
|
||||||
for _, inbound := range 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.AutoRedirect = false
|
||||||
|
inbound.TunOptions.RouteAddressSet = nil
|
||||||
|
inbound.TunOptions.RouteExcludeAddressSet = nil
|
||||||
}
|
}
|
||||||
newInbounds = append(newInbounds, inbound)
|
newInbounds = append(newInbounds, inbound)
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,9 @@ func (t *Template) renderInbounds(metadata M.Metadata, options *option.Options)
|
|||||||
}
|
}
|
||||||
if autoRedirect {
|
if autoRedirect {
|
||||||
tunInbound.TunOptions.AutoRedirect = true
|
tunInbound.TunOptions.AutoRedirect = true
|
||||||
|
if !t.DisableTrafficBypass {
|
||||||
|
tunInbound.TunOptions.RouteExcludeAddressSet = []string{"geoip-cn"}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if t.EnableFakeIP {
|
if t.EnableFakeIP {
|
||||||
tunInbound.TunOptions.InboundOptions.DomainStrategy = domainStrategy
|
tunInbound.TunOptions.InboundOptions.DomainStrategy = domainStrategy
|
||||||
|
Loading…
x
Reference in New Issue
Block a user