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, 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
timeout
- timeout to connect to SOCKS5 proxy in millisecondsjava.io.IOException
- if initializing the socket failed due to a network errorjava.util.concurrent.TimeoutException
- if connecting to SOCKS5 proxy timed outjava.lang.InterruptedException
- if the current thread was interrupted while waitingorg.jivesoftware.smack.XMPPException
org.jivesoftware.smack.SmackException.SmackMessageException
org.jivesoftware.smack.SmackException.NotConnectedException
org.jivesoftware.smack.SmackException.NoResponseException
protected void establish(java.net.Socket socket) throws java.io.IOException, org.jivesoftware.smack.SmackException.SmackMessageException
socket
- connected to a SOCKS5 proxyjava.io.IOException
org.jivesoftware.smack.SmackException.SmackMessageException