Add dns routing option
This commit is contained in:
@@ -36,6 +36,7 @@ type ConfigOptions struct {
|
|||||||
SetSystemProxy bool `json:"set-system-proxy"`
|
SetSystemProxy bool `json:"set-system-proxy"`
|
||||||
BypassLAN bool `json:"bypass-lan"`
|
BypassLAN bool `json:"bypass-lan"`
|
||||||
EnableFakeDNS bool `json:"enable-fake-dns"`
|
EnableFakeDNS bool `json:"enable-fake-dns"`
|
||||||
|
EnableDNSRouting bool `json:"enable-dns-routing"`
|
||||||
IndependentDNSCache bool `json:"independent-dns-cache"`
|
IndependentDNSCache bool `json:"independent-dns-cache"`
|
||||||
GeoIPPath string `json:"geoip-path"`
|
GeoIPPath string `json:"geoip-path"`
|
||||||
GeoSitePath string `json:"geosite-path"`
|
GeoSitePath string `json:"geosite-path"`
|
||||||
@@ -327,15 +328,17 @@ func BuildConfig(configOpt ConfigOptions, input option.Options) option.Options {
|
|||||||
dnsRules = append(dnsRules, dnsRule)
|
dnsRules = append(dnsRules, dnsRule)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, dnsRule := range dnsRules {
|
if configOpt.EnableDNSRouting {
|
||||||
if dnsRule.IsValid() {
|
for _, dnsRule := range dnsRules {
|
||||||
options.DNS.Rules = append(
|
if dnsRule.IsValid() {
|
||||||
options.DNS.Rules,
|
options.DNS.Rules = append(
|
||||||
option.DNSRule{
|
options.DNS.Rules,
|
||||||
Type: C.RuleTypeDefault,
|
option.DNSRule{
|
||||||
DefaultOptions: dnsRule,
|
Type: C.RuleTypeDefault,
|
||||||
},
|
DefaultOptions: dnsRule,
|
||||||
)
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user