node-ftp icon indicating copy to clipboard operation
node-ftp copied to clipboard

Add FTP active mode capability

Open gbourel opened this issue 7 years ago • 4 comments

Add a connection option which allows to use FTP active mode instead of default passive behavior.

The passive option on connect allows to select FTP mode between active or passive:

  • default value is set to true in order to keep same behavior when this option isn't set.
  • when passive is set to true, this FTP client uses active mode, by using the PORT command to trigger a socket connection set up from the FTP server. In order to ensure IP address which should be reached for this connection the activeIp option may be set to define which IP the FTP server must use when initiating this connection.

gbourel avatar Mar 14 '17 17:03 gbourel

eg: var ftpClient = new ftp(); ftpClient.connect({ host: '', port: 21, user: '', password: '', passive:false, activeIp:"" }); ftpClient.on('ready', function () { console.log("ready");//this is right ftpClient.list(dir, function (err, list) {//This list function has no return value if (err) throw err; console.dir(list); ftpClient.end();

    });
});

I use this active mode in my ftp module, but ftpClient.list function has no return value, ready can be show,

748890753yiyi avatar Nov 28 '17 08:11 748890753yiyi

Any news on active mode ?

lroal avatar Feb 09 '18 13:02 lroal

Can this be merged? We need this on some networks.

lracicot avatar Oct 24 '18 16:10 lracicot

Anyone maintaining this PR?

rk-7 avatar Sep 16 '19 09:09 rk-7