public class Socks5Client
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
digest |
protected Bytestream.StreamHost |
streamHost |
Constructor and Description |
---|
Socks5Client(Bytestream.StreamHost streamHost,
java.lang.String digest)
Constructor for a SOCKS5 client.
|
Modifier and Type | Method and Description |
---|---|
protected void |
establish(java.net.Socket socket)
Initializes the connection to the SOCKS5 proxy by negotiating authentication method and
requesting a stream for the given digest.
|
java.net.Socket |
getSocket(int timeout)
Returns the initialized socket that can be used to transfer data between peers via the SOCKS5
proxy.
|
protected Bytestream.StreamHost streamHost
protected java.lang.String digest
public Socks5Client(Bytestream.StreamHost streamHost, java.lang.String digest)
streamHost
- containing network settings of the SOCKS5 proxydigest
- identifying the SOCKS5 Bytestreampublic java.net.Socket getSocket(int timeout) throws java.io.IOException, org.jivesoftware.smack.XMPPException.XMPPErrorException, java.lang.InterruptedException, java.util.concurrent.TimeoutException, org.jivesoftware.smack.SmackException, org.jivesoftware.smack.XMPPException
timeout
- timeout to connect to SOCKS5 proxy in millisecondsjava.io.IOException
- if initializing the socket failed due to a network errororg.jivesoftware.smack.XMPPException.XMPPErrorException
- if establishing connection to SOCKS5 proxy failedjava.util.concurrent.TimeoutException
- if connecting to SOCKS5 proxy timed outjava.lang.InterruptedException
- if the current thread was interrupted while waitingorg.jivesoftware.smack.SmackException
- if the connection to the SOCorg.jivesoftware.smack.XMPPException
protected void establish(java.net.Socket socket) throws org.jivesoftware.smack.SmackException, java.io.IOException
socket
- connected to a SOCKS5 proxyorg.jivesoftware.smack.SmackException
java.io.IOException