forked from mirror/serenity
Set route_exclude_address_set
for routing
This commit is contained in:
parent
a2665f7993
commit
e72f452620
@ -29,6 +29,7 @@ func (t *Template) renderInbounds(metadata M.Metadata, options *option.Options)
|
|||||||
autoRedirect := t.AutoRedirect &&
|
autoRedirect := t.AutoRedirect &&
|
||||||
!metadata.Platform.IsApple() &&
|
!metadata.Platform.IsApple() &&
|
||||||
(metadata.Version == nil || metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.10.0-alpha.2")))
|
(metadata.Version == nil || metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.10.0-alpha.2")))
|
||||||
|
tunExclude := metadata.Platform != M.PlatformAndroid && (metadata.Version == nil || metadata.Version.GreaterThanOrEqual(semver.ParseVersion("1.11.0-beta.14")))
|
||||||
disableTun := t.DisableTUN && !metadata.Platform.TunOnly()
|
disableTun := t.DisableTUN && !metadata.Platform.TunOnly()
|
||||||
if !disableTun {
|
if !disableTun {
|
||||||
options.Route.AutoDetectInterface = true
|
options.Route.AutoDetectInterface = true
|
||||||
@ -39,17 +40,15 @@ func (t *Template) renderInbounds(metadata M.Metadata, options *option.Options)
|
|||||||
tunOptions := &option.TunInboundOptions{
|
tunOptions := &option.TunInboundOptions{
|
||||||
AutoRoute: true,
|
AutoRoute: true,
|
||||||
Address: address,
|
Address: address,
|
||||||
|
AutoRedirect: autoRedirect,
|
||||||
}
|
}
|
||||||
tunInbound := option.Inbound{
|
tunInbound := option.Inbound{
|
||||||
Type: C.TypeTun,
|
Type: C.TypeTun,
|
||||||
Options: tunOptions,
|
Options: tunOptions,
|
||||||
}
|
}
|
||||||
if autoRedirect {
|
if tunExclude && !t.DisableTrafficBypass {
|
||||||
tunOptions.AutoRedirect = true
|
|
||||||
if !t.DisableTrafficBypass && metadata.Platform == "" {
|
|
||||||
tunOptions.RouteExcludeAddressSet = []string{"geoip-cn"}
|
tunOptions.RouteExcludeAddressSet = []string{"geoip-cn"}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if metadata.Platform == M.PlatformUnknown {
|
if metadata.Platform == M.PlatformUnknown {
|
||||||
tunOptions.StrictRoute = true
|
tunOptions.StrictRoute = true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user