fix: RESTful API sniffingEnable

This commit is contained in:
adlyq 2022-11-03 00:31:31 +08:00
parent 7b0cd14b00
commit 508e257543

View file

@ -31,7 +31,7 @@ var (
proxies = make(map[string]C.Proxy) proxies = make(map[string]C.Proxy)
providers map[string]provider.ProxyProvider providers map[string]provider.ProxyProvider
ruleProviders map[string]provider.RuleProvider ruleProviders map[string]provider.RuleProvider
sniffingEnable bool sniffingEnable = false
configMux sync.RWMutex configMux sync.RWMutex
// Outbound Rule // Outbound Rule
@ -108,7 +108,7 @@ func UpdateProxies(newProxies map[string]C.Proxy, newProviders map[string]provid
func UpdateSniffer(dispatcher *sniffer.SnifferDispatcher) { func UpdateSniffer(dispatcher *sniffer.SnifferDispatcher) {
configMux.Lock() configMux.Lock()
sniffer.Dispatcher = dispatcher sniffer.Dispatcher = dispatcher
sniffingEnable = true sniffingEnable = dispatcher.Enable()
configMux.Unlock() configMux.Unlock()
} }