Class SocksProxyRequest
- java.lang.Object
-
- org.apache.mina.proxy.handlers.ProxyRequest
-
- org.apache.mina.proxy.handlers.socks.SocksProxyRequest
-
public class SocksProxyRequest extends ProxyRequest
SocksProxyRequest.java - Wrapper class for SOCKS requests.- Since:
- MINA 2.0.0-M3
-
-
Field Summary
Fields Modifier and Type Field Description private bytecommandCodeThe command code.private java.lang.StringhostThe SOCKS server host name.private java.lang.StringpasswordThe user's password used when authenticating to the proxy server.private intportThe SOCKS server port.private byteprotocolVersionThe SOCKS protocol version.private java.lang.StringserviceKerberosNameThe Kerberos service name used in GSSAPI authentication mode.private java.lang.StringuserNameThe user name used when authenticating to the proxy server.
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description bytegetCommandCode()Return the command code.java.lang.StringgetHost()Return the server host name.byte[]getIpAddress()java.lang.StringgetPassword()Return the user password.byte[]getPort()Return the server port as a byte array.bytegetProtocolVersion()Return the protocol version.java.lang.StringgetServiceKerberosName()Return the Kerberos service name.java.lang.StringgetUserName()Return the user name.voidsetPassword(java.lang.String password)Set the user passwordvoidsetServiceKerberosName(java.lang.String serviceKerberosName)Set the Kerberos service name.-
Methods inherited from class org.apache.mina.proxy.handlers.ProxyRequest
getEndpointAddress
-
-
-
-
Field Detail
-
protocolVersion
private byte protocolVersion
The SOCKS protocol version.
-
commandCode
private byte commandCode
The command code.
-
userName
private java.lang.String userName
The user name used when authenticating to the proxy server.
-
password
private java.lang.String password
The user's password used when authenticating to the proxy server.
-
host
private java.lang.String host
The SOCKS server host name.
-
port
private int port
The SOCKS server port.
-
serviceKerberosName
private java.lang.String serviceKerberosName
The Kerberos service name used in GSSAPI authentication mode.
-
-
Constructor Detail
-
SocksProxyRequest
public SocksProxyRequest(byte protocolVersion, byte commandCode, java.net.InetSocketAddress endpointAddress, java.lang.String userName)Constructor used when building a SOCKS4 request.- Parameters:
protocolVersion- the protocol versioncommandCode- the command codeendpointAddress- the endpoint addressuserName- the user name
-
SocksProxyRequest
public SocksProxyRequest(byte commandCode, java.lang.String host, int port, java.lang.String userName)Constructor used when building a SOCKS4a request.- Parameters:
commandCode- the command codehost- the server host nameport- the server portuserName- the user name
-
-
Method Detail
-
getIpAddress
public byte[] getIpAddress()
- Returns:
- the endpoint address resulting from the
ProxyRequest.getEndpointAddress(). If not set, it will return theSocksProxyConstants.FAKE_IPconstant value which will be ignored in a SOCKS v4 request.
-
getPort
public byte[] getPort()
Return the server port as a byte array.- Returns:
- the server port
-
getCommandCode
public byte getCommandCode()
Return the command code.- Returns:
- the command code
-
getProtocolVersion
public byte getProtocolVersion()
Return the protocol version.- Returns:
- the protocol version
-
getUserName
public java.lang.String getUserName()
Return the user name.- Returns:
- the user name
-
getHost
public final java.lang.String getHost()
Return the server host name.- Returns:
- the server host name
-
getPassword
public java.lang.String getPassword()
Return the user password.- Returns:
- the user password
-
setPassword
public void setPassword(java.lang.String password)
Set the user password- Parameters:
password- the user password value
-
getServiceKerberosName
public java.lang.String getServiceKerberosName()
Return the Kerberos service name.- Returns:
- the Kerberos service name
-
setServiceKerberosName
public void setServiceKerberosName(java.lang.String serviceKerberosName)
Set the Kerberos service name.- Parameters:
serviceKerberosName- the Kerberos service name
-
-