Skip to content

Commit

Permalink
fix(dns): dns-over-tls and dns-over-native-tls serve the same purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Oct 15, 2023
1 parent 6d41ead commit dc4faa6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ dns-over-native-tls-vendored = [
"shadowsocks-service/dns-over-native-tls-vendored",
]
dns-over-https = ["shadowsocks-service/dns-over-https"]
dns-over-h3 = ["shadowsocks-service/dns-over-h3"]

# Enable logging output
logging = ["log4rs"]
Expand Down
15 changes: 12 additions & 3 deletions crates/shadowsocks-service/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2086,7 +2086,10 @@ impl Config {

#[cfg(feature = "hickory-dns")]
"google" => DnsConfig::HickoryDns(ResolverConfig::google()),
#[cfg(all(feature = "hickory-dns", feature = "dns-over-tls"))]
#[cfg(all(
feature = "hickory-dns",
any(feature = "dns-over-tls", feature = "dns-over-native-tls")
))]
"google_tls" => DnsConfig::HickoryDns(ResolverConfig::google_tls()),
#[cfg(all(feature = "hickory-dns", feature = "dns-over-https"))]
"google_https" => DnsConfig::HickoryDns(ResolverConfig::google_https()),
Expand All @@ -2095,14 +2098,20 @@ impl Config {

#[cfg(feature = "hickory-dns")]
"cloudflare" => DnsConfig::HickoryDns(ResolverConfig::cloudflare()),
#[cfg(all(feature = "hickory-dns", feature = "dns-over-tls"))]
#[cfg(all(
feature = "hickory-dns",
any(feature = "dns-over-tls", feature = "dns-over-native-tls")
))]
"cloudflare_tls" => DnsConfig::HickoryDns(ResolverConfig::cloudflare_tls()),
#[cfg(all(feature = "hickory-dns", feature = "dns-over-https"))]
"cloudflare_https" => DnsConfig::HickoryDns(ResolverConfig::cloudflare_https()),

#[cfg(feature = "hickory-dns")]
"quad9" => DnsConfig::HickoryDns(ResolverConfig::quad9()),
#[cfg(all(feature = "hickory-dns", feature = "dns-over-tls"))]
#[cfg(all(
feature = "hickory-dns",
any(feature = "dns-over-tls", feature = "dns-over-native-tls")
))]
"quad9_tls" => DnsConfig::HickoryDns(ResolverConfig::quad9_tls()),
#[cfg(all(feature = "hickory-dns", feature = "dns-over-https"))]
"quad9_https" => DnsConfig::HickoryDns(ResolverConfig::quad9_https()),
Expand Down

0 comments on commit dc4faa6

Please sign in to comment.