node-ftp
node-ftp copied to clipboard
Add FTP active mode capability
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 thePORT
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 theactiveIp
option may be set to define which IP the FTP server must use when initiating this connection.
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,
Any news on active mode ?
Can this be merged? We need this on some networks.
Anyone maintaining this PR?