javajsch代理转发

javajsch代理转发,java,jsch,Java,Jsch,我想将传入的网络数据从设备发送到SSH,但我无法打开通道 JSch sshclient = new JSch(); java.util.Properties config = new java.util.Properties(); Session sshsession = sshclient.getSession("username", "ssh.ssh.com", 22); sshsession.setPassword("password"); config.put("StrictHostK

我想将传入的网络数据从设备发送到SSH,但我无法打开通道

JSch sshclient = new JSch();
java.util.Properties config = new java.util.Properties();
Session sshsession =  sshclient.getSession("username", "ssh.ssh.com", 22);
sshsession.setPassword("password");
config.put("StrictHostKeyChecking", "no");
sshsession.setConfig(config);
sshsession.setProxy(new ProxyHTTP("127.0.0.1",8080)); // local Proxy server running on port 8080
sshsession.connect();
// the above code works, the part below is im unsure
int assignedPort = sshsession.setPortForwardingL(7935, "ssh.com", 22); // not sure here where to connect whether the SSH or the local proxy but I'd like to open a local port at 7935 where ill connect SOCKS5 proxy clients
Channel channel = sshsession.openChannel("direct-tcpip");
((ChannelDirectTCPIP)channel).setHost("127.0.0.1");
((ChannelDirectTCPIP)channel).setPort(8080); 
InputStream in =channel.getInputStream();
OutputStream out = channel.getOutputStream();
channel.connect(); //stops here, doesnt continue
它应该像bitvise的-proxyFwding一样工作它打开了一个代理隧道,我可以在那里连接客户端,比如web浏览器,但我不确定jsch是否有这个功能,或者我的代码是错的