public class GenericSocksCommandSender extends Object implements SocksCommandSender
GenericSocksCommandSender
implements SocksCommandSender
.Modifier and Type | Field and Description |
---|---|
protected static int |
LENGTH_OF_IPV4
length of IPv4 address.
|
protected static int |
LENGTH_OF_IPV6
length of IPv6 address.
|
protected static org.slf4j.Logger |
logger |
ATYPE_DOMAINNAME, ATYPE_IPV4, ATYPE_IPV6, REP_ADDRESS_TYPE_NOT_SUPPORTED, REP_COMMAND_NOT_SUPPORTED, REP_CONNECTION_NOT_ALLOWED_BY_RULESET, REP_CONNECTION_REFUSED, REP_GENERAL_SOCKS_SERVER_FAILURE, REP_HOST_UNREACHABLE, REP_NETWORK_UNREACHABLE, REP_SUCCEEDED, REP_TTL_EXPIRED, RESERVED
Constructor and Description |
---|
GenericSocksCommandSender() |
Modifier and Type | Method and Description |
---|---|
CommandReplyMesasge |
checkServerReply(InputStream inputStream) |
CommandReplyMesasge |
send(Socket socket,
SocksCommand command,
InetAddress address,
int port,
int version)
Send a command to SOCKS server.
|
CommandReplyMesasge |
send(Socket socket,
SocksCommand command,
SocketAddress socketAddress,
int version)
Send a command to SOCKS server.
|
CommandReplyMesasge |
send(Socket socket,
SocksCommand command,
String host,
int port,
int version)
Send a command to SOCKS server and resolve domain name in SOCKS server.
|
protected static final org.slf4j.Logger logger
protected static final int LENGTH_OF_IPV4
protected static final int LENGTH_OF_IPV6
public CommandReplyMesasge send(Socket socket, SocksCommand command, InetAddress address, int port, int version) throws SocksException, IOException
SocksCommandSender
send
in interface SocksCommandSender
socket
- Socket that has connected SOCKS server.command
- The Command such as CONNECT, BIND, UDP ASSOCIATE.address
- Remote server IPv4 or IPv6 address.port
- Remote server port.version
- The version of SOCKS protocol.SocksException
- If any error about SOCKS protocol occurs.IOException
- If any I/O error occurs.public CommandReplyMesasge send(Socket socket, SocksCommand command, SocketAddress socketAddress, int version) throws SocksException, IOException
SocksCommandSender
send
in interface SocksCommandSender
socket
- Socket that has connected SOCKS server.command
- The Command such as CONNECT, BIND, UDP ASSOCIATE.socketAddress
- Remote server address.version
- The version of SOCKS protocol.SocksException
- If any error about SOCKS protocol occurs.IOException
- If any I/O error occurs.public CommandReplyMesasge send(Socket socket, SocksCommand command, String host, int port, int version) throws SocksException, IOException
SocksCommandSender
send
in interface SocksCommandSender
socket
- Socket that has connected SOCKS server.command
- The Command such as CONNECT, BIND, UDP ASSOCIATE.host
- Remote server host. The host will be resolved in SOCKS server.port
- Remote server port.version
- The version of SOCKS protocol.SocksException
- If any error about SOCKS protocol occurs.IOException
- If any I/O error occurs.public CommandReplyMesasge checkServerReply(InputStream inputStream) throws SocksException, IOException
checkServerReply
in interface SocksCommandSender
SocksException
IOException
Copyright © 2015. All rights reserved.