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