Fix interface monitor

This commit is contained in:
世界 2022-10-08 16:48:30 +08:00
parent 7f816a2ebc
commit 89ff9f8368
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -243,9 +243,8 @@ func NewRouter(ctx context.Context, logger log.ContextLogger, dnsLogger log.Cont
router.transportMap = transportMap router.transportMap = transportMap
router.transportDomainStrategy = transportDomainStrategy router.transportDomainStrategy = transportDomainStrategy
needInterfaceMonitor := options.AutoDetectInterface || needInterfaceMonitor := options.AutoDetectInterface || common.Any(inbounds, func(inbound option.Inbound) bool {
C.IsDarwin && common.Any(inbounds, func(inbound option.Inbound) bool { return inbound.HTTPOptions.SetSystemProxy || inbound.MixedOptions.SetSystemProxy || inbound.TunOptions.AutoRoute
return inbound.HTTPOptions.SetSystemProxy || inbound.MixedOptions.SetSystemProxy || C.IsAndroid && inbound.TunOptions.AutoRoute
}) })
if needInterfaceMonitor { if needInterfaceMonitor {