Class Socks5ByteStream

    • Constructor Detail

      • Socks5ByteStream

        public Socks5ByteStream()
        Creates an empty <query/> element.
      • Socks5ByteStream

        public Socks5ByteStream​(String sessionId,
                                Collection<StreamHost> streamHosts,
                                Jid requester,
                                Jid target)
        Creates a <query/> element with an <streamhost/> child elements.
        Parameters:
        sessionId - The session id.
        streamHosts - The stream hosts.
        requester - The requester.
        target - The target.
    • Method Detail

      • activate

        public static Socks5ByteStream activate​(String sessionId,
                                                Jid jid)
        Creates a <query/> element with an <activate/> child element.
        Parameters:
        sessionId - The session id.
        jid - The JID.
        Returns:
        The query element.
      • streamHostUsed

        public static Socks5ByteStream streamHostUsed​(String sessionId,
                                                      Jid jid)
        Creates a <query/> element with an <streamhost-used/> child element.
        Parameters:
        sessionId - session id.
        jid - The JID.
        Returns:
        The query element.
      • hash

        public static String hash​(String sessionId,
                                  Jid requesterJid,
                                  Jid targetJid)
        Creates the hexadecimal-encoded SHA-1 hash for usage in SOCKS5 negotiation.
        Parameters:
        sessionId - The session id
        requesterJid - The requester JID
        targetJid - The target JID.
        Returns:
        The hexadecimal-encoded SHA-1 hash.
        See Also:
        6.3.2 Target Establishes SOCKS5 Connection with Proxy
      • getStreamHosts

        public final List<StreamHost> getStreamHosts()
        Gets the stream hosts.
        Returns:
        The stream hosts.
      • getSessionId

        public final String getSessionId()
        Gets the session id.
        Returns:
        The session id.
      • getStreamHostUsed

        public final Jid getStreamHostUsed()
        Gets the used stream host.
        Returns:
        The used stream host.
      • getDestinationAddress

        public final String getDestinationAddress()
        Gets the DST.ADDR, i.e. the hash of the SID + requester JID + target JID.
        Returns:
        The DST.ADDR hash.