Multiple Tunnels in one DLL - WeOnlyDo Discussion board

Multiple Tunnels in one DLL (General questions)

by Aing, Tuesday, July 31, 2007, 08:34 (6329 days ago)

I created a DLL to wrap the wodSSHTunnel.dll. So that it could plug-in to my current application with very little changes.

I would like to know if it is possible to create more than one tunnels in one DLL? The only condition would be that all tunnels will connect to the same SSH server and forward to different RemoteAddress/RemotePort.

Thank you,
Aing

Re: Multiple Tunnels in one DLL

by woddrazen, Tuesday, July 31, 2007, 10:45 (6329 days ago) @ Aing

Hi Aing,


Yes you can done that easily. You should just call in wodSSHTunnel Connected Event wodSSHTunnel Channels Object Add Method multiple time and tunnel will be created.

When you add all tunnel you want, you should start them all with Channels Object Start Method.

Example for LocalListen:
[code]
Private Sub ssh_1_Connected()
SSH_1.Channels.Add LocalListen, 0.0.0.0 , 22, 127.0.0.1 , 22
SSH_1.Channels.Add LocalListen, 0.0.0.0 , 50000, 127.0.0.1 , 50000

SSH_1.Channels.StartAll
End Sub
[/code]

Example for RemoteListen:
[code]
Private Sub ssh_1_Connected()
SSH_1.Channels.Add RemoteListen, 127.0.0.1 , 80, 0.0.0.0 , 888
SSH_1.Channels.Add RemoteListen, 127.0.0.1 , 22, 0.0.0.0 , 222

SSH_1.Channels.StartAll
End Sub
[/code]

More help for Add Method you can find here:
http://www.weonlydo.com/SSHTunnel/Help/wodSSHTunnelLib~Channels~Add.html

and more help for Start Method you can find here:
http://www.weonlydo.com/SSHTunnel/Help/wodSSHTunnelLib~Channels~StartAll.html

Hope this helps.


Regards,
Drazen