node-argyle
node-argyle copied to clipboard
Question: on a possible authentication implementation
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) {})).