rename TcpProxy to ProxyHandler

This commit is contained in:
ssrlive 2023-09-01 11:28:06 +08:00
parent 11995d525b
commit e5a645638a
3 changed files with 35 additions and 41 deletions

View file

@ -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();