Class SocksCmdResponse

    • Constructor Detail

      • SocksCmdResponse

        public SocksCmdResponse​(SocksCmdStatus cmdStatus,
                                SocksAddressType addressType,
                                java.lang.String host,
                                int port)
        Constructs new response and includes provided host and port as part of it.
        Parameters:
        cmdStatus - status of the response
        addressType - type of host parameter
        host - host (BND.ADDR field) is address that server used when connecting to the target host. When null a value of 4/8 0x00 octets will be used for IPv4/IPv6 and a single 0x00 byte will be used for domain addressType. Value is converted to ASCII using IDN.toASCII(String).
        port - port (BND.PORT field) that the server assigned to connect to the target host
        Throws:
        java.lang.NullPointerException - in case cmdStatus or addressType are missing
        java.lang.IllegalArgumentException - in case host or port cannot be validated
        See Also:
        IDN.toASCII(String)