Fix SOCKS5 domain name address type sending

This commit is contained in:
B. Blechschmidt 2023-03-22 19:28:48 +01:00
parent 1a5eeece6f
commit 56d0dd9d42

View file

@ -205,9 +205,10 @@ impl SocksConnection {
IpAddr::V6(ip) => self.server_outbuf.extend(ip.octets().as_ref()),
};
}
DestinationHost::Hostname(_) => {
DestinationHost::Hostname(host) => {
self.server_outbuf
.extend(&[SocksAddressType::DomainName as u8]);
.extend(&[SocksAddressType::DomainName as u8, host.len() as u8]);
self.server_outbuf.extend(host.as_bytes());
}
}
self.server_outbuf.extend(&[