public class Socks5Client extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
digest |
protected Bytestream.StreamHost |
streamHost |
Constructor and Description |
---|
Socks5Client(Bytestream.StreamHost streamHost,
String digest)
Constructor for a SOCKS5 client.
|
Modifier and Type | Method and Description |
---|---|
protected void |
establish(Socket socket)
Initializes the connection to the SOCKS5 proxy by negotiating authentication method and
requesting a stream for the given digest.
|
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
public Socks5Client(Bytestream.StreamHost streamHost, String digest)
streamHost
- containing network settings of the SOCKS5 proxydigest
- identifying the SOCKS5 Bytestreampublic Socket getSocket(int timeout) throws IOException, InterruptedException, TimeoutException, SmackException, XMPPException
timeout
- timeout to connect to SOCKS5 proxy in millisecondsIOException
- if initializing the socket failed due to a network errorTimeoutException
- if connecting to SOCKS5 proxy timed outInterruptedException
- if the current thread was interrupted while waitingSmackException
- if the connection to the SOCKS5 proxy failedXMPPException
protected void establish(Socket socket) throws SmackException, IOException
socket
- connected to a SOCKS5 proxySmackException
IOException