|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectHTTPClient.SocksClient
This class implements a SOCKS Client. Supports both versions 4 and 5. GSSAPI however is not yet implemented.
Usage is as follows: somewhere in the initialization code (and before
the first socket creation call) create a SocksClient instance. Then replace
each socket creation call
sock = new Socket(host, port);
with
sock = socks_client.getSocket(host, port);
(where socks_client is the above created SocksClient instance).
That's all.
| Constructor Summary | |
(package private) |
SocksClient(String host,
int port)
Creates a new SOCKS Client using the specified host and port for the server. |
(package private) |
SocksClient(String host,
int port,
int version)
Creates a new SOCKS Client using the specified host and port for the server. |
| Method Summary | |
(package private) Socket |
getSocket(String host,
int port)
Initiates a connection to the socks server, does the startup protocol and returns a socket ready for talking. |
(package private) Socket |
getSocket(String host,
int port,
InetAddress localAddr,
int localPort)
Initiates a connection to the socks server, does the startup protocol and returns a socket ready for talking. |
String |
toString()
produces a string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
SocksClient(String host,
int port)
host - the host the SOCKS server is sitting on.port - the port the SOCKS server is listening on.
SocksClient(String host,
int port,
int version)
throws SocksException
host - the host the SOCKS server is sitting on.port - the port the SOCKS server is listening on.version - the version the SOCKS server is using.
SocksException - if the version is invalid (Currently allowed
are: 4 and 5).| Method Detail |
Socket getSocket(String host,
int port)
throws IOException
host - the host you wish to connect toport - the port you wish to connect to
IOException - if any socket operation fails
Socket getSocket(String host,
int port,
InetAddress localAddr,
int localPort)
throws IOException
host - the host you wish to connect toport - the port you wish to connect tolocalAddr - the local address to bind tolocalPort - the local port to bind to
IOException - if any socket operation failspublic String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||