There is nothing built-in to node to auto-read htpassword files.  You'll
need a library that implements the authentication. The easiest is to
implement http basic auth <
http://en.wikipedia.org/wiki/Basic_access_authentication> (the one where
your browser shows an ugly blocking popup asking for username and password)

Most http frameworks have a library for this built-in.  I would look up the
docs for Express or something if you're not comfortable implementing the
spec yourself (not that it's hard, I don't want to scare you away)

On Tue, May 29, 2012 at 2:32 PM, TINO THOMAS <[email protected]> wrote:

> Hello,
>
> I would like to password protect a node.js website running on port 8000. I
> am not sure what method to follow for this.
> Will installing htpasswd (https://github.com/gevorg/htpasswd#readme) will
> help to achieve this?.
> I installed htpasswd and created a password file using htpasswd -c
> command. But I am not sure how to proceed after this.
> Can anyone please help me to complete this task.
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to