Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
9.6k views
in Java FTP by (460 points)
We are using ProFTPClient API to connect FTP server using SOCKS5 protocol.The connectivity and file transfer works good with FTP PASV mode and fails with "ACTIVE" mode. The destination FTP server supports both "ACTIVE" and "PASV" mode.we tried with multiple destination servers.

Is there known issue FTP+SOCKS5+ACTIVE on ProFtpClient???

Please see below code snippet
  ProFTPClient ftp = new ProFTPClient();
        ftp.setTimeout(60000);
        ftp.setRemoteHost(host);
        ftp.setRemotePort(port.intValue());
        ftp.getProxySettings().setPublicProxyAddress(proxyServer);
        ftp.getProxySettings().setProxyAddress(proxyServer);
        ftp.getProxySettings().setProxyPort(proxyPort.intValue());
        ftp.getProxySettings().setProxyType(ProxyType.SOCKS5);
            ftp.connect();
            ftp.login(sftpBean.getUserId(), sftpBean.getPassword());
            ftp.setConnectMode(FTPConnectMode.ACTIVE);
            ftp.setType(FTPTransferType.BINARY);
            ftp.chdir(sftpBean.getDestFolder());
            ftp.put(bis, srcFile);

3 Answers

0 votes
by (162k points)
Does it work with Filezilla?
0 votes
by (460 points)
Does it work with Filezilla?


We tried with File zilla,We were able to connect the server but unable to transfer the file using FTP+SOCKS+ACTIVE.The target doest support both active and passive.Also, We are able to transfer files with ACTIVE and PASV through internet.

Here is Filezilla FTP+SOCKS+ACTIVE logs

Status: Connecting to xxxx.xxxx.xxx through proxy

Status: Resolving address of xxxx.xxxx.xxx

Status: Connecting to socks_proxy:1080...

Status: Connection with proxy established, performing handshake...

Status: Connection established, waiting for welcome message...

Response: 220 xxxxxx NcFTPd Server (licensed copy) ready.

Command: USER test

Response: 331 User test okay, need password.

Command: PASS ********

Response: 230-You are user #86 of 5000 simultaneous users allowed.

Response: 230-

Response: 230 Restricted user logged in.

Command: CLNT FileZilla

Response: 200 Noted.

Command: OPTS UTF8 ON

Response: 501 Option not recognized.

Command: OPTS MLST type;size;modify;perm;unix.mode;unix.owner;unix.uid;unix.group;unix.gid;

Response: 200 Options accepted: type;size;modify;perm;unix.mode;unix.owner;unix.uid;unix.group;unix.gid;

Status: Connected

Status: Retrieving directory listing...

Command: PWD

Response: 257 "/" is cwd.

Command: TYPE I

Response: 200 Type okay.

Command: PASV

Response: 227 Entering Passive Mode (160,83,78,166,208,177)

Command: MLSD

Status: Connecting to xxxxx:1080...

Status: Connection with proxy established, performing handshake...

Error: Proxy handshake failed: ECONNABORTED - Connection aborted
0 votes
by (162k points)
If Filezilla has the same problem you need to look for what other problem it might be - possibly a firewall blocking the connection.

Categories

...