Archived Forum Post

Index of archived forum posts

Question:

How to use CkSshTunnel in iOS?

Dec 26 '12 at 05:27

Hi,

Can I use CkSshTunnel(cpp one) in my iOS project? I couldn't find an equivalent in objective-c header file.

Xcode reported many compilation error when i try to include it in my application delegate.


Answer

Here is the new C++ lib build for iOS that includes CkSshTunnel:

http://www.chilkatsoft.com/preRelease/chilkat-9.4.0-macosx.tar.gz


Answer

I confirmed that it is missing. I will try to create a new build for iOS that also includes CkSshTunnel either today or tomorrow, and will post a comment here with the download link when it's ready.


Answer

I'm working on a Proof of Concept for an IPhone APP with SSH Tunnel and have the same problem. I made my first tests with the content of Chilkat-9.3.2-IOS-6.0.zip
But the content of your new build is total different and that confused me a lot. I think because it is for OS-X. Could you please provide SshTunnel.h also in the IOS version.


Answer

Sorry -- my fault. I had uploaded the build OS-X instead of iOS. Here's the new build for iOS:

http://www.chilkatsoft.com/preRelease/Chilkat-9.4.0-IOS-6.0.zip


Answer

Hi,

I tested the iOS build but encounter arbitrary error from the debugger.(e.g. EXC_BAD_ACCESS).

This is my code to test the build, relatively simple and copy from C++ one. Any idea?

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{ // Override point for customization after application launch.
CkoSshTunnel *sshTunnel = [[CkoSshTunnel alloc] init];

//  Any string automatically begins a fully-functional 30-day trial.
BOOL success;
success = [sshTunnel UnlockComponent: @"Anything for 30-day trial"];
if (success != YES) {
    NSLog(@"Unlock error");
}

//  The destination host/port is the database server.
//  The DestHostname may be the domain name or
//  IP address (in dotted decimal notation) of the database
//  server.
[sshTunnel setDestHostname:@"www.google.com"];
[sshTunnel setDestPort:[NSNumber numberWithInt: 80]];

//  Provide information about the location of the SSH server,
//  and the authentication to be used with it. This is the
//  login information for the SSH server (not the database server).
[sshTunnel setSshHostname:@"mysshserver"];
[sshTunnel setSshPort:[NSNumber numberWithInt: 22]];
[sshTunnel setSshLogin:@"username"];
[sshTunnel setSshPassword:@"password"];

//  Start accepting connections in a background thread.
//  The SSH tunnels are autonomously run in a background
//  thread.  There is one background thread for accepting
//  connections, and another for managing the tunnel pool.
success = [sshTunnel BeginAccepting:[NSNumber numberWithInt: 80]];
if (success != YES) {
    NSLog(@"Listen error");
}

return YES;

}