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