| Constructor and Description |
|---|
ProxySOCKS4(String proxy_host)
Creates a new ProxySOCKS5 object.
|
ProxySOCKS4(String proxy_host,
int proxy_port)
Creates a new ProxyHTTP object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection.
|
void |
connect(SocketFactory socket_factory,
String host,
int port,
int timeout)
Opens a connection to the target server.
|
static int |
getDefaultPort()
returns the default proxy port - this is 1080 as defined for SOCKS.
|
InputStream |
getInputStream()
Returns an InputStream to read data from the remote server.
|
OutputStream |
getOutputStream()
Returns an OutputStream to write data to the remote server.
|
Socket |
getSocket()
Returns the socket used for the connection.
|
void |
setUserPasswd(String user,
String passwd)
Sets the user name and password needed for authentication
to the proxy.
|
public ProxySOCKS4(String proxy_host)
proxy_host - the proxie's host name, maybe including the port
number separated by :. (The default port is 1080.)public ProxySOCKS4(String proxy_host, int proxy_port)
proxy_host - the proxie's host name.proxy_port - the port number of the proxy.public void setUserPasswd(String user, String passwd)
user - the user namepasswd - the password.public void connect(SocketFactory socket_factory, String host, int port, int timeout) throws JSchException
Proxyconnect in interface Proxysocket_factory - a factory for sockets. Might be null, then
the implementation will use plain sockets.host - the SSH server host we want to connect to.port - the port at the SSH server.timeout - how long to wait maximally for a connection, in
milliseconds. If 0, wait as long as needed.JSchExceptionpublic InputStream getInputStream()
ProxygetInputStream in interface Proxypublic OutputStream getOutputStream()
ProxygetOutputStream in interface Proxypublic Socket getSocket()
Proxypublic void close()
Proxypublic static int getDefaultPort()
This is a simplified version of the inofficial Javadoc created by PaĆlo Ebermann. Have a look at the official homepage.