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

Question: on a possible authentication implementation

Open samuel-allan opened this issue 8 years ago • 0 comments

If I (or anyone else) were to start implementing an authentication mode (e.g. user/pass or IP-based), what would be the preferred format (e.g. as a function, as a server.on('') event).

Based on my experience working with repositories such as mscdex/socksv5, I would suggest using either:

  • Authentication callback to a function (e.g. function(user, pass, ip) { return false/true; }) with a promise, which can be set in the constructor (creating the server). OR
  • A separate method, used to set authentication (e.g. server.setAuth(function (user, pass, ip) {})).

samuel-allan avatar Feb 20 '17 15:02 samuel-allan