Open gbourel opened 7 years ago
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?
Add a connection option which allows to use FTP active mode instead of default passive behavior.
The
passive
option onconnect
allows to select FTP mode between active or passive:true
in order to keep same behavior when this option isn't set.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.