Issue
I need to connect via TCP to a port that's behind a firewall, accessible through an SSH tunnel. I can achieve connection by opening a tunnel and hittting that port, but I want to build this tunneling in to my application.
Additionally, I want to be able to provide automatic login by use of having authorized keys on the server
This must work on the following platforms (in order of importance)
- iOS (trickiest because I can't fork an ssh tunnel like I can on other platforms)
- OS X
- Linux
- Windows
What's the easy way to do this? I don't want to spend a great deal of effort obviously since this isn't the meat of my application. But I'll reuse it so I may care enough to "do things right"
Solution
But libssh2 is BSD-licensed and appears to have the functionality needed
Looks like: libssh2_channel_direct_tcpip_ex will be the call
Note that the LGPL'd libssh is a problem because on iOS apps you MUST statically link and CANNOT dynamically link to libraries. Therefore, using an LGPL'd library means my source becomes open source.
Answered By - Nektarios Answer Checked By - Marie Seifert (WPSolving Admin)