public final class SocksCmdResponse extends SocksResponse
构造器和说明 |
---|
SocksCmdResponse(SocksCmdStatus cmdStatus,
SocksAddressType addressType) |
SocksCmdResponse(SocksCmdStatus cmdStatus,
SocksAddressType addressType,
java.lang.String host,
int port)
Constructs new response and includes provided host and port as part of it.
|
限定符和类型 | 方法和说明 |
---|---|
SocksAddressType |
addressType()
Returns the
SocksAddressType of this SocksCmdResponse |
SocksCmdStatus |
cmdStatus()
Returns the
SocksCmdStatus of this SocksCmdResponse |
void |
encodeAsByteBuf(ByteBuf byteBuf) |
java.lang.String |
host()
Returns host that is used as a parameter in
SocksCmdType . |
int |
port()
Returns port that is used as a parameter in
SocksCmdType . |
responseType
protocolVersion, type
public SocksCmdResponse(SocksCmdStatus cmdStatus, SocksAddressType addressType)
public SocksCmdResponse(SocksCmdStatus cmdStatus, SocksAddressType addressType, java.lang.String host, int port)
cmdStatus
- status of the responseaddressType
- type of host parameterhost
- host (BND.ADDR field) is address that server used when connecting to the target host.
When null a value of 4/8 0x00 octets will be used for IPv4/IPv6 and a single 0x00 byte will be
used for domain addressType. Value is converted to ASCII using IDN.toASCII(String)
.port
- port (BND.PORT field) that the server assigned to connect to the target hostjava.lang.NullPointerException
- in case cmdStatus or addressType are missingjava.lang.IllegalArgumentException
- in case host or port cannot be validatedIDN.toASCII(String)
public SocksCmdStatus cmdStatus()
SocksCmdStatus
of this SocksCmdResponse
SocksCmdStatus
of this SocksCmdResponse
public SocksAddressType addressType()
SocksAddressType
of this SocksCmdResponse
SocksAddressType
of this SocksCmdResponse
public java.lang.String host()
SocksCmdType
.
Host (BND.ADDR field in response) is address that server used when connecting to the target host.
This is typically different from address which client uses to connect to the SOCKS server.SocksCmdType
or null when there was no host specified during response constructionpublic int port()
SocksCmdType
.
Port (BND.PORT field in response) is port that the server assigned to connect to the target host.SocksCmdType
public void encodeAsByteBuf(ByteBuf byteBuf)
encodeAsByteBuf
在类中 SocksMessage