I was using Jsch 0.1.39 to do file transfer with a SFTP server via a proxy.
It worked well for me in case of HTTP and SOCKS5 proxies.
In case of SOCKS4 proxy, it didn't work at all.
I looked into the class ProxySOCKS4 and saw the following code in method connect(...):
int i=in.read(buf, s, len-s);
throw new JSchException("ProxySOCKS4: stream is closed");
I thought the total byte length should be 8, so I changed int len=6; to int len=8; and then the SOCKS4 proxy worked for me.
Atsuhiko, is this a bug?