move load.go init to patch.go
This commit is contained in:
2 files changed
+26
-26
No files matched your search
@@ -6,7 +6,6 @@ import (
|
||||
|
||||
"github.com/Dreamacro/clash/config"
|
||||
"github.com/Dreamacro/clash/constant"
|
||||
"github.com/Dreamacro/clash/dns"
|
||||
"github.com/Dreamacro/clash/hub/executor"
|
||||
"github.com/Dreamacro/clash/log"
|
||||
"github.com/kr328/cfa/tun"
|
||||
@@ -30,31 +29,6 @@ Rule:
|
||||
- 'MATCH,DIRECT'
|
||||
`
|
||||
|
||||
func init() {
|
||||
defaultNameServers := []string{
|
||||
"223.5.5.5",
|
||||
"119.29.29.29",
|
||||
"1.1.1.1",
|
||||
"208.67.222.222",
|
||||
}
|
||||
|
||||
OptionalDnsPatch = &config.RawDNS{
|
||||
Enable: true,
|
||||
IPv6: true,
|
||||
NameServer: defaultNameServers,
|
||||
Fallback: []string{},
|
||||
FallbackFilter: config.RawFallbackFilter{
|
||||
GeoIP: false,
|
||||
IPCIDR: []string{},
|
||||
},
|
||||
Listen: ":0",
|
||||
EnhancedMode: dns.FAKEIP,
|
||||
FakeIPRange: "198.18.0.0/16",
|
||||
FakeIPFilter: []string{},
|
||||
DefaultNameserver: defaultNameServers,
|
||||
}
|
||||
}
|
||||
|
||||
// LoadDefault - load default configure
|
||||
func LoadDefault() {
|
||||
DnsPatch = nil
|
||||
|
||||
@@ -3,6 +3,7 @@ package config
|
||||
import (
|
||||
"github.com/Dreamacro/clash/component/fakeip"
|
||||
"github.com/Dreamacro/clash/config"
|
||||
"github.com/Dreamacro/clash/dns"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
@@ -14,6 +15,31 @@ var (
|
||||
cachedPool *fakeip.Pool
|
||||
)
|
||||
|
||||
func init() {
|
||||
defaultNameServers := []string{
|
||||
"223.5.5.5",
|
||||
"119.29.29.29",
|
||||
"1.1.1.1",
|
||||
"208.67.222.222",
|
||||
}
|
||||
|
||||
OptionalDnsPatch = &config.RawDNS{
|
||||
Enable: true,
|
||||
IPv6: true,
|
||||
NameServer: defaultNameServers,
|
||||
Fallback: []string{},
|
||||
FallbackFilter: config.RawFallbackFilter{
|
||||
GeoIP: false,
|
||||
IPCIDR: []string{},
|
||||
},
|
||||
Listen: ":0",
|
||||
EnhancedMode: dns.FAKEIP,
|
||||
FakeIPRange: "198.18.0.0/16",
|
||||
FakeIPFilter: []string{},
|
||||
DefaultNameserver: defaultNameServers,
|
||||
}
|
||||
}
|
||||
|
||||
func patchRawConfig(rawConfig *config.RawConfig) {
|
||||
rawConfig.DNS.FakeIPRange = "198.18.0.0/16"
|
||||
rawConfig.Experimental.Interface = ""
|
||||
|
||||
Reference in new issue
Block a user