Code: refresh code & rebase branch 'with-tun'
This commit is contained in:
@ -16,6 +16,7 @@ import (
|
||||
"github.com/Dreamacro/clash/component/profile"
|
||||
"github.com/Dreamacro/clash/component/profile/cachefile"
|
||||
"github.com/Dreamacro/clash/component/resolver"
|
||||
S "github.com/Dreamacro/clash/component/script"
|
||||
"github.com/Dreamacro/clash/component/trie"
|
||||
"github.com/Dreamacro/clash/config"
|
||||
C "github.com/Dreamacro/clash/constant"
|
||||
@ -76,6 +77,7 @@ func ApplyConfig(cfg *config.Config, force bool) {
|
||||
updateUsers(cfg.Users)
|
||||
updateProxies(cfg.Proxies, cfg.Providers)
|
||||
updateRules(cfg.Rules)
|
||||
updateRuleProviders(cfg.RuleProviders)
|
||||
updateHosts(cfg.Hosts)
|
||||
updateProfile(cfg)
|
||||
updateDNS(cfg.DNS, cfg.Tun)
|
||||
@ -176,6 +178,10 @@ func updateRules(rules []C.Rule) {
|
||||
tunnel.UpdateRules(rules)
|
||||
}
|
||||
|
||||
func updateRuleProviders(providers map[string]C.Rule) {
|
||||
S.UpdateRuleProviders(providers)
|
||||
}
|
||||
|
||||
func updateTun(tun *config.Tun, tunAddressPrefix string) {
|
||||
P.ReCreateTun(tun, tunAddressPrefix, tunnel.TCPIn(), tunnel.UDPIn())
|
||||
}
|
||||
@ -308,4 +314,5 @@ func Cleanup() {
|
||||
if runtime.GOOS == "linux" {
|
||||
tproxy.CleanUpTProxyLinuxIPTables()
|
||||
}
|
||||
S.Py_Finalize()
|
||||
}
|
||||
|
Reference in New Issue
Block a user