I'm looking for a way to connect to my remote server using ssh binding inside my java application. I enter the command like below inside my terminal to connect my server:
ssh -D 1234 [email protected]
then I can configure my browser socks ip & port to:
socks ip: 127.0.0.1
socks port: 1234
& use my server to browse inside internet
now please help me to do this in my java application.
currently I use a library called JSCH in my program but I couldn't get my application to work. Do you have any Idea or sample code or whatever for this problem ?
(notice that both SOCKS v4 & v5 should be supported inside the java library)
You would get multiple options
-http://mina.apache.org/sshd-project/documentation.html Trusted Apache project with good support in form of user community,docs & examples I think this is what you were asking for. https://svn.apache.org/repos/asf/mina/sshd/trunk/sshd-core/src/test/java/org/apache/sshd/PortForwardingTest.java
-http://www.jcraft.com/jsch/ Bad documentation but has been in existence for a long time.Sample code is pretty good.
http://code.google.com/p/ganymed-ssh-2/
Another lib with just sufficent documnetation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With