Class SOCKSHeader


  • public class SOCKSHeader
    extends Object
    Save the SOCKS header from a datagram Ref: RFC 1928
    Author:
    zzz
    • Constructor Detail

      • SOCKSHeader

        public SOCKSHeader​(byte[] data)
        Parameters:
        data - the whole packet
        Throws:
        IllegalArgumentException - on bad socks format
      • SOCKSHeader

        public SOCKSHeader​(Destination dest,
                           int port)
        Make a dummy header from a dest, for those cases where we want to receive unsolicited datagrams. Unused for now.
        Parameters:
        port - I2CP port 0-65535
        Since:
        0.9.53 add port param
    • Method Detail

      • getHost

        public String getHost()
        As of 0.9.53, returns IP address as a string for address types 1 and 4.
        Returns:
        hostname or null for unknown address type
      • getPort

        public int getPort()
        Returns:
        0 - 65535
        Since:
        0.9.53
      • getDestination

        public Destination getDestination()
        Returns:
        destination or null
      • getBytes

        public byte[] getBytes()