mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-27 01:06:08 +00:00
get_credentials removed
This commit is contained in:
parent
2122cc0ba8
commit
59fa5b155e
3 changed files with 3 additions and 12 deletions
|
@ -401,7 +401,7 @@ impl ConnectionManager for HttpManager {
|
|||
}
|
||||
Ok(Box::new(HttpConnection::new(
|
||||
info,
|
||||
self.get_credentials().clone(),
|
||||
self.credentials.clone(),
|
||||
self.digest_state.clone(),
|
||||
)?))
|
||||
}
|
||||
|
@ -409,10 +409,6 @@ impl ConnectionManager for HttpManager {
|
|||
fn get_server_addr(&self) -> SocketAddr {
|
||||
self.server
|
||||
}
|
||||
|
||||
fn get_credentials(&self) -> &Option<UserKey> {
|
||||
&self.credentials
|
||||
}
|
||||
}
|
||||
|
||||
impl HttpManager {
|
||||
|
|
|
@ -346,17 +346,13 @@ impl ConnectionManager for SocksProxyManager {
|
|||
fn new_proxy_handler(&self, info: &ConnectionInfo, udp_associate: bool) -> Result<Box<dyn ProxyHandler>> {
|
||||
use socks5_impl::protocol::Command::{Connect, UdpAssociate};
|
||||
let command = if udp_associate { UdpAssociate } else { Connect };
|
||||
let credentials = self.get_credentials().clone();
|
||||
let credentials = self.credentials.clone();
|
||||
Ok(Box::new(SocksProxyImpl::new(info, credentials, self.version, command)?))
|
||||
}
|
||||
|
||||
fn get_server_addr(&self) -> SocketAddr {
|
||||
self.server
|
||||
}
|
||||
|
||||
fn get_credentials(&self) -> &Option<UserKey> {
|
||||
&self.credentials
|
||||
}
|
||||
}
|
||||
|
||||
impl SocksProxyManager {
|
||||
|
|
|
@ -18,7 +18,7 @@ use smoltcp::{
|
|||
time::Instant,
|
||||
wire::{IpCidr, IpProtocol, Ipv4Packet, Ipv6Packet, TcpPacket, UdpPacket, UDP_HEADER_LEN},
|
||||
};
|
||||
use socks5_impl::protocol::{Address, StreamOperation, UdpHeader, UserKey};
|
||||
use socks5_impl::protocol::{Address, StreamOperation, UdpHeader};
|
||||
use std::collections::LinkedList;
|
||||
#[cfg(target_family = "unix")]
|
||||
use std::os::unix::io::AsRawFd;
|
||||
|
@ -205,7 +205,6 @@ pub(crate) trait ProxyHandler {
|
|||
pub(crate) trait ConnectionManager {
|
||||
fn new_proxy_handler(&self, info: &ConnectionInfo, udp_associate: bool) -> Result<Box<dyn ProxyHandler>>;
|
||||
fn get_server_addr(&self) -> SocketAddr;
|
||||
fn get_credentials(&self) -> &Option<UserKey>;
|
||||
}
|
||||
|
||||
const TUN_TOKEN: Token = Token(0);
|
||||
|
|
Loading…
Add table
Reference in a new issue