Class Socks5Utils


  • public class Socks5Utils
    extends java.lang.Object
    A collection of utility methods for SOcKS5 messages.
    • Constructor Summary

      Constructors 
      Constructor Description
      Socks5Utils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String createDigest​(java.lang.String sessionID, Jid initiatorJID, Jid targetJID)
      Returns a SHA-1 digest of the given parameters as specified in XEP-0065.
      static byte[] receiveSocks5Message​(java.io.DataInputStream in)
      Reads a SOCKS5 message from the given InputStream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createDigest

        public static java.lang.String createDigest​(java.lang.String sessionID,
                                                    Jid initiatorJID,
                                                    Jid targetJID)
        Returns a SHA-1 digest of the given parameters as specified in XEP-0065.
        Parameters:
        sessionID - for the SOCKS5 Bytestream
        initiatorJID - JID of the initiator of a SOCKS5 Bytestream
        targetJID - JID of the target of a SOCKS5 Bytestream
        Returns:
        SHA-1 digest of the given parameters
      • receiveSocks5Message

        public static byte[] receiveSocks5Message​(java.io.DataInputStream in)
                                           throws java.io.IOException,
                                                  SmackException.SmackMessageException
        Reads a SOCKS5 message from the given InputStream. The message can either be a SOCKS5 request message or a SOCKS5 response message.

        (see RFC1928)

        Parameters:
        in - the DataInputStream to read the message from
        Returns:
        the SOCKS5 message
        Throws:
        java.io.IOException - if a network error occurred
        SmackException.SmackMessageException - if the SOCKS5 message contains an unsupported address type