public interface Proxy
A Proxy object creates a Socket and it's two streams for a remote server. It typically does this by first connecting to a proxy server, negiotiating some conditions (or providing a password) and then returning the streams as the connection will be forwarded to the target host.
The library (i.e.
Session) uses a proxy only if given with
setProxy before connecting. When connecting,
it will use the methods defined in this interface (except close), and
it will invoke
close() on disconnecting.
Some implementing classes for common proxy types are delivered with
An application might also create their own implementations and provide
these to the session before connecting.
|Modifier and Type||Method and Description|
Closes the connection.
Opens a connection to the target server.
Returns an InputStream to read data from the remote server.
Returns an OutputStream to write data to the remote server.
Returns the socket used for the connection.
void connect(SocketFactory socket_factory, String host, int port, int timeout) throws Exception
socket_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.
Exception- if it was not possible to create the connection to the target host for some reason.
This is a simplified version of the inofficial Javadoc created by Paŭlo Ebermann. Have a look at the official homepage.