Reverse Port Forward using libssh2 on iOS
Asked Answered
P

1

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.

Piranha answered 10/8, 2011 at 19:37 Comment(6)
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!Piranha
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)Conlen
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.Piranha
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.Piranha
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.Monseigneur
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?Piranha
B
1

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

Bricklayer answered 25/9, 2011 at 0:32 Comment(3)
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).Piranha
I'm going to clean it up and github it when i get a chanceBricklayer
Do you need any help? If you post it I can start cleaning it up and poking at it.Piranha

© 2022 - 2024 — McMap. All rights reserved.