Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: on a possible authentication implementation #4

Open
samuel-allan opened this issue Feb 20, 2017 · 0 comments
Open

Question: on a possible authentication implementation #4

samuel-allan opened this issue Feb 20, 2017 · 0 comments

Comments

@samuel-allan
Copy link

samuel-allan commented Feb 20, 2017

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) {})).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant