mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-23 01:20:52 +00:00
connection_managers renamed to connection_manager
This commit is contained in:
parent
d00a18c865
commit
46ca342aba
4 changed files with 20 additions and 56 deletions
|
@ -5,7 +5,6 @@ use crate::{
|
|||
OutgoingDirection, TcpProxy,
|
||||
},
|
||||
};
|
||||
use smoltcp::wire::IpProtocol;
|
||||
use socks5_impl::protocol::{self, handshake, password_method, Address, AuthMethod, StreamOperation, UserKey, Version};
|
||||
use std::{collections::VecDeque, convert::TryFrom, net::SocketAddr};
|
||||
|
||||
|
@ -336,14 +335,7 @@ pub(crate) struct SocksProxyManager {
|
|||
}
|
||||
|
||||
impl ConnectionManager for SocksProxyManager {
|
||||
fn handles_connection(&self, info: &ConnectionInfo) -> bool {
|
||||
info.protocol == IpProtocol::Tcp
|
||||
}
|
||||
|
||||
fn new_tcp_proxy(&self, info: &ConnectionInfo, udp_associate: bool) -> Result<Box<dyn TcpProxy>> {
|
||||
if info.protocol != IpProtocol::Tcp {
|
||||
return Err("Invalid protocol".into());
|
||||
}
|
||||
use socks5_impl::protocol::Command::{Connect, UdpAssociate};
|
||||
let command = if udp_associate { UdpAssociate } else { Connect };
|
||||
Ok(Box::new(SocksProxyImpl::new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue