The Add method will create a new channel and add it to the
collection of all currently defined channels. After you
create a channel, you should Start it to make
it accept new connections.
Each channel can be defined as one of three possible types -
LocalListen,
RemoteListen or
SocksProxy.
When you define a new channel as LocalListen then the local computer will bind a new
socket to the LocalAddress
interface on LocalPort and
when a new connection arrives it will forward it to the SSH
server at RemoteAddress
on RemotePort.
So, wodSSHTunnel will initiate connections towards the SSH
server in this case.
If a new channel is defined as RemoteListen, then SSH server will bind
RemoteAddress on RemotePort (Note: RemoteAddress as
seen from the SSH server's end!!). When a new connection
comes to the selected RemotePort, the SSH server will send a
notification to wodSSHTunnel, which will initiate a new
connection towards the LocalAddress interface on LocalPort.
Defining a new channel as SocksProxy
will cause wodSSHTunnel to open a local port (on the
LocalAddress interface). When applications connect to that
port it will provide information about the dynamic tunnel to be created
- at the Hostname/Port required by the application.
The
SocksConnect and
SocksBind
events will fire to notify you about such operations.
The RemoteAddress and
RemotePort arguments are ignored when this type of tunnel is
created - they cannot be predefined because the application will choose
them on a per connection basis.
If you don't set up the optional arguments in the Add
method, you must define them later on (but before you call the
Start method!).