public final class SocksCmdResponse extends SocksResponse
SocksCmdRequest
,
SocksCmdResponseDecoder
Constructor and Description |
---|
SocksCmdResponse(SocksCmdStatus cmdStatus,
SocksAddressType addressType) |
SocksCmdResponse(SocksCmdStatus cmdStatus,
SocksAddressType addressType,
String host,
int port)
Constructs new response and includes provided host and port as part of it.
|
Modifier and Type | Method and Description |
---|---|
SocksAddressType |
addressType()
Returns the
SocksAddressType of this SocksCmdResponse |
SocksCmdStatus |
cmdStatus()
Returns the
SocksCmdStatus of this SocksCmdResponse |
void |
encodeAsByteBuf(ByteBuf byteBuf) |
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, 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 hostNullPointerException
- in case cmdStatus or addressType are missingIllegalArgumentException
- 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 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
in class SocksMessage
Copyright © 2008–2024 The Netty Project. All rights reserved.