fix: Adjust the timing of loading proxy selection

This commit is contained in:
Skyxim 2022-05-08 07:58:26 +08:00
parent 2fbbf7519f
commit 55811dae32

View file

@ -2,6 +2,7 @@ package executor
import ( import (
"fmt" "fmt"
"github.com/Dreamacro/clash/listener/inner"
"net/netip" "net/netip"
"os" "os"
"runtime" "runtime"
@ -78,21 +79,20 @@ func ApplyConfig(cfg *config.Config, force bool) {
updateSniffer(cfg.Sniffer) updateSniffer(cfg.Sniffer)
updateHosts(cfg.Hosts) updateHosts(cfg.Hosts)
updateDNS(cfg.DNS) updateDNS(cfg.DNS)
initInnerTcp()
loadProviders(cfg) loadProxyProvider(cfg.Providers)
updateProfile(cfg)
loadRuleProvider(cfg.RuleProviders)
updateGeneral(cfg.General, force) updateGeneral(cfg.General, force)
updateIPTables(cfg) updateIPTables(cfg)
updateTun(cfg.Tun, cfg.DNS) updateTun(cfg.Tun, cfg.DNS)
updateExperimental(cfg) updateExperimental(cfg)
updateProfile(cfg)
log.SetLevel(cfg.General.LogLevel) log.SetLevel(cfg.General.LogLevel)
} }
func loadProviders(cfg *config.Config) { func initInnerTcp() {
P.NewInner(tunnel.TCPIn()) inner.New(tunnel.TCPIn())
loadProxyProvider(cfg.Providers)
loadRuleProvider(cfg.RuleProviders)
} }
func GetGeneral() *config.General { func GetGeneral() *config.General {