mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-23 07:19:08 +00:00
remove useless get_server_addr
This commit is contained in:
parent
a08b3338c3
commit
181497e709
5 changed files with 4 additions and 19 deletions
|
@ -423,10 +423,6 @@ impl ProxyHandlerManager for HttpManager {
|
||||||
HttpConnection::new(self.server, info, domain_name, self.credentials.clone(), self.digest_state.clone()).await?,
|
HttpConnection::new(self.server, info, domain_name, self.credentials.clone(), self.digest_state.clone()).await?,
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_server_addr(&self) -> SocketAddr {
|
|
||||||
self.server
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HttpManager {
|
impl HttpManager {
|
||||||
|
|
|
@ -214,7 +214,7 @@ where
|
||||||
ProxyType::Socks5 => Arc::new(SocksProxyManager::new(server_addr, V5, key)) as Arc<dyn ProxyHandlerManager>,
|
ProxyType::Socks5 => Arc::new(SocksProxyManager::new(server_addr, V5, key)) as Arc<dyn ProxyHandlerManager>,
|
||||||
ProxyType::Socks4 => Arc::new(SocksProxyManager::new(server_addr, V4, key)) as Arc<dyn ProxyHandlerManager>,
|
ProxyType::Socks4 => Arc::new(SocksProxyManager::new(server_addr, V4, key)) as Arc<dyn ProxyHandlerManager>,
|
||||||
ProxyType::Http => Arc::new(HttpManager::new(server_addr, key)) as Arc<dyn ProxyHandlerManager>,
|
ProxyType::Http => Arc::new(HttpManager::new(server_addr, key)) as Arc<dyn ProxyHandlerManager>,
|
||||||
ProxyType::None => Arc::new(NoProxyManager::new(server_addr)) as Arc<dyn ProxyHandlerManager>,
|
ProxyType::None => Arc::new(NoProxyManager::new()) as Arc<dyn ProxyHandlerManager>,
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut ipstack_config = ipstack::IpStackConfig::default();
|
let mut ipstack_config = ipstack::IpStackConfig::default();
|
||||||
|
|
|
@ -80,9 +80,7 @@ impl ProxyHandler for NoProxyHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) struct NoProxyManager {
|
pub(crate) struct NoProxyManager;
|
||||||
server: SocketAddr,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
impl ProxyHandlerManager for NoProxyManager {
|
impl ProxyHandlerManager for NoProxyManager {
|
||||||
|
@ -100,14 +98,10 @@ impl ProxyHandlerManager for NoProxyManager {
|
||||||
udp_associate,
|
udp_associate,
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_server_addr(&self) -> SocketAddr {
|
|
||||||
self.server
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl NoProxyManager {
|
impl NoProxyManager {
|
||||||
pub(crate) fn new(server: SocketAddr) -> Self {
|
pub(crate) fn new() -> Self {
|
||||||
Self { server }
|
Self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,5 +27,4 @@ pub(crate) trait ProxyHandlerManager: Send + Sync {
|
||||||
domain_name: Option<String>,
|
domain_name: Option<String>,
|
||||||
udp_associate: bool,
|
udp_associate: bool,
|
||||||
) -> std::io::Result<Arc<Mutex<dyn ProxyHandler>>>;
|
) -> std::io::Result<Arc<Mutex<dyn ProxyHandler>>>;
|
||||||
fn get_server_addr(&self) -> SocketAddr;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -354,10 +354,6 @@ impl ProxyHandlerManager for SocksProxyManager {
|
||||||
command,
|
command,
|
||||||
)?)))
|
)?)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_server_addr(&self) -> SocketAddr {
|
|
||||||
self.server
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SocksProxyManager {
|
impl SocksProxyManager {
|
||||||
|
|
Loading…
Add table
Reference in a new issue