Hi guys, I am trying to local port forward in my iOS app. I am using cksshtunnel class for that. It returns true in the end but there is no log in my SSH server which shows that ssh tunnel has been established. I am using FreeSSHD for my ssh server on windows 7. Here I include a snippet of code from my app. I have seen the example given on chilkat site for port forwarding but that only returns a channel. I want my another application to listen to my local forwarded port (RDP in my case).
asked Dec 27 '12 at 07:29
The call to BeginAccepting starts a background thread that will begin accepting incoming connections. No connection is made to the SSH server at that point. The background thread is simply waiting for incoming connections -- which may come from your foreground thread (such as a newly created TCP socket that makes a connection to localhost:listenPort, or some external program that connects to the listenPort.
When the background thread accepts a new connection on listenPort, it establishes a new connection to the SSH server. Incoming data is forwarded through the SSH server to the DestHostname:DestPort. Data arriving from the other direction (i.e. from DestHostname:DestPort, through the SSH server, and received in the background thread), is forwarded back to the connected socket.
answered Dec 27 '12 at 10:35