| java.lang.Object HTTPClient.SocksClient
SocksClient | class SocksClient implements GlobalConstants(Code) | | 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.
version: 0.3-2 18/06/1999 author: Ronald Tschalär |
Constructor Summary | |
| SocksClient(String host, int port) Creates a new SOCKS Client using the specified host and port for
the server. | | SocksClient(String host, int port, int version) Creates a new SOCKS Client using the specified host and port for
the server. |
Method Summary | |
Socket | getSocket(String host, int port) Initiates a connection to the socks server, does the startup
protocol and returns a socket ready for talking. | public String | toString() produces a string. |
SocksClient | SocksClient(String host, int port)(Code) | | Creates a new SOCKS Client using the specified host and port for
the server. Will try to establish the SOCKS version used when
establishing the first connection.
Parameters: host - the host the SOCKS server is sitting on. Parameters: port - the port the SOCKS server is listening on. |
SocksClient | SocksClient(String host, int port, int version) throws SocksException(Code) | | Creates a new SOCKS Client using the specified host and port for
the server.
Parameters: host - the host the SOCKS server is sitting on. Parameters: port - the port the SOCKS server is listening on. Parameters: version - the version the SOCKS server is using. exception: SocksException - if the version is invalid (Currently allowedare: 4 and 5). |
getSocket | Socket getSocket(String host, int port) throws IOException(Code) | | Initiates a connection to the socks server, does the startup
protocol and returns a socket ready for talking.
Parameters: host - the host you wish to connect to Parameters: port - the port you wish to connect to a Socket with a connection via socks to the desired host/port exception: IOException - if any socket operation fails |
toString | public String toString()(Code) | | produces a string.
a string containing the host and port of the socks server |
|
|