Just to let you know, I have implemented dynamic port forwarding on
top of JSch for my android application, SSH Persistent Tunnels.
I used jsocks for the SOCKS part. I had to trivially patch a few files
from jsocks (just make some members and methods protected instead of
The actual implementations is in:
I am sure it's far from optimal since it is built on top of JSch
instead of being fully integrated. Someone with better knowledge of
the JSch code base could probably integrate it better.
Licensing notet: jsocks is LGPL, and the code I wrote
(DynamicForwarder.java) is GPLv3. If someone were to integrate it into
JSch, I am willing to release my code under a license similar to
You can browse all of the code in:
Thank you Dr. Atsuhiko Yamanaka for JSch
SPT - persistent SSH tunnels for android.