|
1 | | -use std::{ |
2 | | - fmt::{Debug, Display, Formatter}, |
3 | | - net, |
4 | | - str::FromStr, |
5 | | - sync::Arc, |
6 | | - time::Duration, |
7 | | -}; |
8 | | - |
9 | | -use async_trait::async_trait; |
10 | | - |
11 | | -use futures::{TryFutureExt, future::BoxFuture}; |
12 | | -use hickory_client::client; |
13 | | -use hickory_proto::{ |
14 | | - ProtoError, runtime::iocompat::AsyncIoTokioAsStd, |
15 | | - rustls::tls_client_stream::tls_client_connect_with_future, tcp::TcpClientStream, |
16 | | - udp::UdpClientStream, |
17 | | -}; |
18 | | -use rustls::ClientConfig; |
19 | | -use tokio::{sync::RwLock, task::JoinHandle}; |
20 | | -use tracing::{info, instrument, trace, warn}; |
21 | | - |
| 1 | +use super::{ClashResolver, Client, runtime::DnsRuntimeProvider}; |
22 | 2 | use crate::{ |
23 | 3 | Error, |
24 | 4 | app::net::{OutboundInterface, TUN_SOMARK}, |
25 | 5 | common::tls::{self, GLOBAL_ROOT_STORE}, |
26 | 6 | dns::{ThreadSafeDNSClient, dhcp::DhcpClient}, |
27 | 7 | proxy::utils::new_tcp_stream, |
28 | 8 | }; |
| 9 | +use anyhow::anyhow; |
| 10 | +use async_trait::async_trait; |
| 11 | +use futures::{TryFutureExt, future::BoxFuture}; |
| 12 | +use hickory_client::client; |
29 | 13 | use hickory_proto::{ |
30 | | - DnsHandle, |
| 14 | + DnsHandle, ProtoError, |
31 | 15 | h2::HttpsClientStreamBuilder, |
32 | 16 | op::Message, |
| 17 | + runtime::iocompat::AsyncIoTokioAsStd, |
| 18 | + rustls::tls_client_stream::tls_client_connect_with_future, |
| 19 | + tcp::TcpClientStream, |
| 20 | + udp::UdpClientStream, |
33 | 21 | xfer::{DnsRequest, DnsRequestOptions, FirstAnswer}, |
34 | 22 | }; |
35 | | -use tokio::net::TcpStream as TokioTcpStream; |
36 | | - |
37 | | -use super::{ClashResolver, Client, runtime::DnsRuntimeProvider}; |
| 23 | +use rustls::ClientConfig; |
| 24 | +use std::{ |
| 25 | + fmt::{Debug, Display, Formatter}, |
| 26 | + net, |
| 27 | + str::FromStr, |
| 28 | + sync::Arc, |
| 29 | + time::Duration, |
| 30 | +}; |
| 31 | +use tokio::{net::TcpStream as TokioTcpStream, sync::RwLock, task::JoinHandle}; |
| 32 | +use tracing::{info, instrument, trace, warn}; |
38 | 33 |
|
39 | 34 | #[derive(Clone, Debug, PartialEq)] |
40 | 35 | pub enum DNSNetMode { |
|
0 commit comments