Skip to main content

write_request_header

Function write_request_header 

Source
pub fn write_request_header(
    buf: &mut BytesMut,
    hash_hex: &[u8],
    command: u8,
    address: &AddressRef<'_>,
) -> Result<(), WriteError>
Expand description

Writes a Trojan request header to the buffer.

ยงErrors

  • InvalidHashLen if hash is not exactly 56 bytes.
  • DomainTooLong if address contains a domain longer than 255 bytes.