Skip to content

Commit

Permalink
fix(dns): dns-over-h3 requires QuicLocalAddr
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Oct 15, 2023
1 parent dc4faa6 commit 304c181
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions crates/shadowsocks/src/dns_resolver/hickory_dns_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ use hickory_resolver::{
config::{LookupIpStrategy, ResolverConfig, ResolverOpts},
error::ResolveResult,
name_server::{GenericConnector, RuntimeProvider},
proto::{iocompat::AsyncIoTokioAsStd, udp::DnsUdpSocket, TokioTime},
AsyncResolver,
TokioHandle,
proto::{
iocompat::AsyncIoTokioAsStd,
udp::{DnsUdpSocket, QuicLocalAddr},
TokioTime,
},
AsyncResolver, TokioHandle,
};
use log::trace;
use tokio::{io::ReadBuf, net::UdpSocket};
Expand Down Expand Up @@ -59,6 +62,12 @@ impl DnsUdpSocket for ShadowUdpSocket {
}
}

impl QuicLocalAddr for ShadowUdpSocket {
fn local_addr(&self) -> io::Result<SocketAddr> {
self.deref().local_addr()
}
}

impl RuntimeProvider for ShadowDnsRuntimeProvider {
type Handle = TokioHandle;
type Tcp = AsyncIoTokioAsStd<ShadowTcpStream>;
Expand Down

0 comments on commit 304c181

Please sign in to comment.