9

I'm looking for some example code of a reverse port forward on iOS using libssh2. Here's a close example:

Example code of libssh2 being used for port forwarding

But I'd like it to be tailored to iOS and objective-C if possible. Straight C is fine too. I'm wary of the socket and FD code, and would rather have a robust solution than the one I'm hacking up. I've tried RTFMing libssh2 for a while, but it ends up being just RTF Code... and I'm not confident enough in my C code to do this networking part.

EDIT: bounty for a working implementation of ssh with port forwarding on iOS 4.3 (e.g. iphone4, ipad2), doesn't need to be libssh2 in specific.

Community
  • 1
  • 1
Ralphleon
  • 3,968
  • 5
  • 32
  • 34
  • Also, I didn't mean to be so demanding :) I plan on offering a bounty, as this seems to be a very difficult thing to find! – Ralphleon Aug 10 '11 at 19:44
  • The code snippet that is provided in the link you posted, is hardly "C++" Just remove the usage of std::*, and you should have a perfectly usable C version. However, remember to test it, before using it. I don't see how this whole exercise is useful to other programmers as a question though (hence the downvote) – shiva Aug 23 '11 at 21:31
  • That's what I've been trying but the code fragment doesn't seem to work. I just replaced the boost:: yields with some timeouts etc. There's also some proprietary windows calls in there too. – Ralphleon Aug 23 '11 at 21:54
  • 4
    Also, if you scour libssh2's mailing list, this question has been asked a whole heap of times. If posting example code to stack overflow isn't useful, than perhaps I'm missing the purpose of this site. – Ralphleon Aug 23 '11 at 21:55
  • I think you are indeed missing the point of this site. It's not a place where you just ask for code samples regarding x or y; it's more of a share your efforts and have others criticize and correct them. – Mahmoud Al-Qudsi Sep 25 '11 at 04:07
  • 1
    That might be your purpose (and I can respect that), but for me this site is about communicating with other developers to solve problems. This is a problem, and i'm asking for help. The code is almost exactly like the other question i've referenced. Perhaps you could explain how this question could be better worded? – Ralphleon Sep 26 '11 at 23:21

1 Answers1

1

As it turns out, it's fairly straightforward to migrate the putty source http://www.chiark.greenend.org.uk/~sgtatham/putty/ to ios ...

Foo Bah
  • 25,660
  • 5
  • 55
  • 79
  • Any links to an ongoing effort? Googling provides nothing for me. Also, I was not aware that putty had a library... the source code is for the entire binary (much like openssh). – Ralphleon Sep 26 '11 at 23:20
  • I'm going to clean it up and github it when i get a chance – Foo Bah Sep 27 '11 at 11:28
  • Do you need any help? If you post it I can start cleaning it up and poking at it. – Ralphleon Sep 27 '11 at 15:53