Skip to content

Commit

Permalink
feat(dns): support google dns-over-h3
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Oct 15, 2023
1 parent 52f525d commit 6d41ead
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 9 deletions.
104 changes: 103 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/shadowsocks-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dns-over-https = [
"hickory-resolver/dns-over-https",
"hickory-resolver/dns-over-https-rustls",
]
dns-over-h3 = ["hickory-dns", "hickory-resolver/dns-over-h3"]

# Enable DNS-relay
local-dns = ["local", "hickory-dns"]
Expand Down
15 changes: 7 additions & 8 deletions crates/shadowsocks-service/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,7 @@ use serde::{Deserialize, Serialize};
use shadowsocks::relay::socks5::Address;
use shadowsocks::{
config::{
ManagerAddr,
Mode,
ReplayAttackPolicy,
ServerAddr,
ServerConfig,
ServerUser,
ServerUserManager,
ServerWeight,
ManagerAddr, Mode, ReplayAttackPolicy, ServerAddr, ServerConfig, ServerUser, ServerUserManager, ServerWeight,
},
crypto::CipherKind,
plugin::PluginConfig,
Expand Down Expand Up @@ -2093,6 +2086,12 @@ impl Config {

#[cfg(feature = "hickory-dns")]
"google" => DnsConfig::HickoryDns(ResolverConfig::google()),
#[cfg(all(feature = "hickory-dns", feature = "dns-over-tls"))]
"google_tls" => DnsConfig::HickoryDns(ResolverConfig::google_tls()),
#[cfg(all(feature = "hickory-dns", feature = "dns-over-https"))]
"google_https" => DnsConfig::HickoryDns(ResolverConfig::google_https()),
#[cfg(all(feature = "hickory-dns", feature = "dns-over-h3"))]
"google_h3" => DnsConfig::HickoryDns(ResolverConfig::google_h3()),

#[cfg(feature = "hickory-dns")]
"cloudflare" => DnsConfig::HickoryDns(ResolverConfig::cloudflare()),
Expand Down

0 comments on commit 6d41ead

Please sign in to comment.