public class SocksProxyRequest extends ProxyRequest
| Modifier and Type | Field and Description |
|---|---|
private byte |
commandCode
The command code.
|
private java.lang.String |
host
The SOCKS server host name.
|
private java.lang.String |
password
The user's password used when authenticating to the proxy server.
|
private int |
port
The SOCKS server port.
|
private byte |
protocolVersion
The SOCKS protocol version.
|
private java.lang.String |
serviceKerberosName
The Kerberos service name used in GSSAPI authentication mode.
|
private java.lang.String |
userName
The user name used when authenticating to the proxy server.
|
| Constructor and Description |
|---|
SocksProxyRequest(byte protocolVersion,
byte commandCode,
java.net.InetSocketAddress endpointAddress,
java.lang.String userName)
Constructor used when building a SOCKS4 request.
|
SocksProxyRequest(byte commandCode,
java.lang.String host,
int port,
java.lang.String userName)
Constructor used when building a SOCKS4a request.
|
| Modifier and Type | Method and Description |
|---|---|
byte |
getCommandCode()
Return the command code.
|
java.lang.String |
getHost()
Return the server host name.
|
byte[] |
getIpAddress()
Returns the endpoint address resulting from the
ProxyRequest.getEndpointAddress(). |
java.lang.String |
getPassword()
Return the user password.
|
byte[] |
getPort()
Return the server port as a byte array.
|
byte |
getProtocolVersion()
Return the protocol version.
|
java.lang.String |
getServiceKerberosName()
Return the Kerberos service name.
|
java.lang.String |
getUserName()
Return the user name.
|
void |
setPassword(java.lang.String password)
Set the user password
|
void |
setServiceKerberosName(java.lang.String serviceKerberosName)
Set the Kerberos service name.
|
getEndpointAddressprivate byte protocolVersion
private byte commandCode
private java.lang.String userName
private java.lang.String password
private java.lang.String host
private int port
private java.lang.String serviceKerberosName
public SocksProxyRequest(byte protocolVersion,
byte commandCode,
java.net.InetSocketAddress endpointAddress,
java.lang.String userName)
protocolVersion - the protocol versioncommandCode - the command codeendpointAddress - the endpoint addressuserName - the user namepublic SocksProxyRequest(byte commandCode,
java.lang.String host,
int port,
java.lang.String userName)
commandCode - the command codehost - the server host nameport - the server portuserName - the user namepublic byte[] getIpAddress()
ProxyRequest.getEndpointAddress().
If not set, it will return the SocksProxyConstants.FAKE_IP constant
value which will be ignored in a SOCKS v4 request.public byte[] getPort()
public byte getCommandCode()
public byte getProtocolVersion()
public java.lang.String getUserName()
public final java.lang.String getHost()
public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password - the user password valuepublic java.lang.String getServiceKerberosName()
public void setServiceKerberosName(java.lang.String serviceKerberosName)
serviceKerberosName - the Kerberos service name