mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-23 09:30:54 +00:00
rename TcpProxy to ProxyHandler
This commit is contained in:
parent
11995d525b
commit
e5a645638a
3 changed files with 35 additions and 41 deletions
|
@ -2,7 +2,7 @@ use crate::{
|
|||
error::{Error, Result},
|
||||
tun2proxy::{
|
||||
ConnectionInfo, ConnectionManager, Direction, IncomingDataEvent, IncomingDirection, OutgoingDataEvent,
|
||||
OutgoingDirection, TcpProxy,
|
||||
OutgoingDirection, ProxyHandler,
|
||||
},
|
||||
};
|
||||
use socks5_impl::protocol::{self, handshake, password_method, Address, AuthMethod, StreamOperation, UserKey, Version};
|
||||
|
@ -268,7 +268,7 @@ impl SocksProxyImpl {
|
|||
}
|
||||
}
|
||||
|
||||
impl TcpProxy for SocksProxyImpl {
|
||||
impl ProxyHandler for SocksProxyImpl {
|
||||
fn get_connection_info(&self) -> &ConnectionInfo {
|
||||
&self.info
|
||||
}
|
||||
|
@ -346,7 +346,7 @@ pub(crate) struct SocksProxyManager {
|
|||
}
|
||||
|
||||
impl ConnectionManager for SocksProxyManager {
|
||||
fn new_tcp_proxy(&self, info: &ConnectionInfo, udp_associate: bool) -> Result<Box<dyn TcpProxy>> {
|
||||
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.credentials.clone();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue