mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-23 17:40:55 +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(
|
Ok(Box::new(HttpConnection::new(
|
||||||
info,
|
info,
|
||||||
self.get_credentials().clone(),
|
self.credentials.clone(),
|
||||||
self.digest_state.clone(),
|
self.digest_state.clone(),
|
||||||
)?))
|
)?))
|
||||||
}
|
}
|
||||||
|
@ -409,10 +409,6 @@ impl ConnectionManager for HttpManager {
|
||||||
fn get_server_addr(&self) -> SocketAddr {
|
fn get_server_addr(&self) -> SocketAddr {
|
||||||
self.server
|
self.server
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_credentials(&self) -> &Option<UserKey> {
|
|
||||||
&self.credentials
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HttpManager {
|
impl HttpManager {
|
||||||
|
|
|
@ -346,17 +346,13 @@ impl ConnectionManager for SocksProxyManager {
|
||||||
fn new_proxy_handler(&self, info: &ConnectionInfo, udp_associate: bool) -> Result<Box<dyn ProxyHandler>> {
|
fn new_proxy_handler(&self, info: &ConnectionInfo, udp_associate: bool) -> Result<Box<dyn ProxyHandler>> {
|
||||||
use socks5_impl::protocol::Command::{Connect, UdpAssociate};
|
use socks5_impl::protocol::Command::{Connect, UdpAssociate};
|
||||||
let command = if udp_associate { UdpAssociate } else { Connect };
|
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)?))
|
Ok(Box::new(SocksProxyImpl::new(info, credentials, self.version, command)?))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_server_addr(&self) -> SocketAddr {
|
fn get_server_addr(&self) -> SocketAddr {
|
||||||
self.server
|
self.server
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_credentials(&self) -> &Option<UserKey> {
|
|
||||||
&self.credentials
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SocksProxyManager {
|
impl SocksProxyManager {
|
||||||
|
|
|
@ -18,7 +18,7 @@ use smoltcp::{
|
||||||
time::Instant,
|
time::Instant,
|
||||||
wire::{IpCidr, IpProtocol, Ipv4Packet, Ipv6Packet, TcpPacket, UdpPacket, UDP_HEADER_LEN},
|
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;
|
use std::collections::LinkedList;
|
||||||
#[cfg(target_family = "unix")]
|
#[cfg(target_family = "unix")]
|
||||||
use std::os::unix::io::AsRawFd;
|
use std::os::unix::io::AsRawFd;
|
||||||
|
@ -205,7 +205,6 @@ pub(crate) trait ProxyHandler {
|
||||||
pub(crate) trait ConnectionManager {
|
pub(crate) trait ConnectionManager {
|
||||||
fn new_proxy_handler(&self, info: &ConnectionInfo, udp_associate: bool) -> Result<Box<dyn ProxyHandler>>;
|
fn new_proxy_handler(&self, info: &ConnectionInfo, udp_associate: bool) -> Result<Box<dyn ProxyHandler>>;
|
||||||
fn get_server_addr(&self) -> SocketAddr;
|
fn get_server_addr(&self) -> SocketAddr;
|
||||||
fn get_credentials(&self) -> &Option<UserKey>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const TUN_TOKEN: Token = Token(0);
|
const TUN_TOKEN: Token = Token(0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue