simple-ftpd icon indicating copy to clipboard operation
simple-ftpd copied to clipboard

How to close the connection

Open Stylesoftware opened this issue 6 years ago • 1 comments

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
}

Stylesoftware avatar Jun 30 '18 07:06 Stylesoftware

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.

kamicane avatar Jul 21 '18 10:07 kamicane