mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-23 01:20:52 +00:00
UDP associate
This commit is contained in:
parent
46ca342aba
commit
da87fa8d5a
3 changed files with 34 additions and 6 deletions
|
@ -224,7 +224,9 @@ impl SocksProxyImpl {
|
|||
return Err(format!("SOCKS connection failed: {}", response.reply).into());
|
||||
}
|
||||
if self.command == protocol::Command::UdpAssociate {
|
||||
self.udp_associate = Some(SocketAddr::try_from(response.address)?);
|
||||
self.udp_associate = Some(SocketAddr::try_from(&response.address)?);
|
||||
assert!(self.data_buf.is_empty());
|
||||
log::debug!("UDP associate: {}", response.address);
|
||||
}
|
||||
|
||||
self.server_outbuf.append(&mut self.data_buf);
|
||||
|
@ -326,6 +328,10 @@ impl TcpProxy for SocksProxyImpl {
|
|||
fn reset_connection(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn get_udp_associate(&self) -> Option<SocketAddr> {
|
||||
self.udp_associate
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) struct SocksProxyManager {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue