Skip to content

Question: on a possible authentication implementation #4

@samuel-allan

Description

@samuel-allan

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) {})).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions