public class SocksProxy extends Object
Contains the host, port, version, and if names should be resolved by the proxy.
Modifier and Type | Class and Description |
---|---|
static class |
SocksProxy.Version
The version of the SOCKS proxy.
|
Constructor and Description |
---|
SocksProxy(String host,
int port)
Constructs a
SocksProxy with the given host and port. |
SocksProxy(String host,
int port,
SocksProxy.Version version,
boolean useDns)
Constructs a
SocksProxy with the given data. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getHost()
Gets the host (name or address).
|
int |
getPort()
Gets the port.
|
SocksProxy.Version |
getVersion()
Gets the version.
|
int |
hashCode() |
boolean |
isUseDns()
Tells whether or not the names should be resolved by the proxy.
|
String |
toString() |
public SocksProxy(String host, int port)
SocksProxy
with the given host and port.
Uses SocksProxy.Version.SOCKS5
and names are resolved by the proxy.
host
- the host, must not be null
or empty.port
- the port.NullPointerException
- if the host
is null.IllegalArgumentException
- if the host
is empty or the port
is not a
valid port number.public SocksProxy(String host, int port, SocksProxy.Version version, boolean useDns)
SocksProxy
with the given data.host
- the host, must not be null
or empty.port
- the port.version
- the version, must not be null
.useDns
- true
if the names should be resolved by the proxy, false
otherwise.NullPointerException
- if the host
or version
is null
.IllegalArgumentException
- if the host
is empty or the port
is not a
valid port number.public String getHost()
null
or empty.public int getPort()
public SocksProxy.Version getVersion()
null
.public boolean isUseDns()
Only supported by SocksProxy.Version.SOCKS5
.
true
if the names should be resolved by the proxy, false
otherwise.