simple-ftpd
simple-ftpd copied to clipboard
How to close the connection
Looking for something like:
session.on('pass', (username, password, cb) => {
if (username === 'admin' && password === 'adminpw') {
session.readOnly = false;
cb(null, 'Welcome admin')
} else {
session.close(); session.end(); // these don't seem to do too much
}
It's been a while, but I believe you are supposed to respond with an error object:
cb(new Error('you are not welcome here.'))
That responds with a code 530. I don't believe you are supposed to truncate the session.