Class Socks5ClientForInitiator


  • public class Socks5ClientForInitiator
    extends Socks5Client
    Implementation of a SOCKS5 client used on the initiators side. This is needed because connecting to the local SOCKS5 proxy differs form the regular way to connect to a SOCKS5 proxy. Additionally a remote SOCKS5 proxy has to be activated by the initiator before data can be transferred between the peers.
    • Constructor Summary

      Constructors 
      Constructor Description
      Socks5ClientForInitiator​(Bytestream.StreamHost streamHost, java.lang.String digest, org.jivesoftware.smack.XMPPConnection connection, java.lang.String sessionID, org.jxmpp.jid.Jid target)
      Creates a new SOCKS5 client for the initiators side.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.Socket getSocket​(int timeout)
      Returns the initialized socket that can be used to transfer data between peers via the SOCKS5 proxy.
      • Methods inherited from class java.lang.Object

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

      • Socks5ClientForInitiator

        public Socks5ClientForInitiator​(Bytestream.StreamHost streamHost,
                                        java.lang.String digest,
                                        org.jivesoftware.smack.XMPPConnection connection,
                                        java.lang.String sessionID,
                                        org.jxmpp.jid.Jid target)
        Creates a new SOCKS5 client for the initiators side.
        Parameters:
        streamHost - containing network settings of the SOCKS5 proxy
        digest - identifying the SOCKS5 Bytestream
        connection - the XMPP connection
        sessionID - the session ID of the SOCKS5 Bytestream
        target - the target JID of the SOCKS5 Bytestream
    • Method Detail

      • getSocket

        public java.net.Socket getSocket​(int timeout)
                                  throws java.io.IOException,
                                         java.lang.InterruptedException,
                                         java.util.concurrent.TimeoutException,
                                         org.jivesoftware.smack.XMPPException,
                                         org.jivesoftware.smack.SmackException.SmackMessageException,
                                         org.jivesoftware.smack.SmackException.NotConnectedException,
                                         org.jivesoftware.smack.SmackException.NoResponseException
        Description copied from class: Socks5Client
        Returns the initialized socket that can be used to transfer data between peers via the SOCKS5 proxy.
        Overrides:
        getSocket in class Socks5Client
        Parameters:
        timeout - timeout to connect to SOCKS5 proxy in milliseconds
        Returns:
        socket the initialized socket
        Throws:
        java.io.IOException - if initializing the socket failed due to a network error
        java.lang.InterruptedException - if the current thread was interrupted while waiting
        java.util.concurrent.TimeoutException - if connecting to SOCKS5 proxy timed out
        org.jivesoftware.smack.XMPPException - if an XMPP protocol error was received.
        org.jivesoftware.smack.SmackException.SmackMessageException - if there was an error.
        org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
        org.jivesoftware.smack.SmackException.NoResponseException - if there was no response from the remote entity.