title: Basic HTTP authentication in Node.JS?
body: <p>I'm trying to write a REST-API server with NodeJS like the one used by <a href="http://api.no.de" rel="noreferrer">Joyent</a>, and everything is ok except I can't verify a normal user's authentication. If I jump to a terminal and do <code>curl -u username:password localhost:8000 -X GET</code>, I can't get the values username:password on the NodeJS http server. If my NodeJS http server is something like </p>
  
  <pre><code>var http = require('http');
  http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Hello World\n');
  }).listen(1337, "127.0.0.1");
  </code></pre>
  
  <p>, shouldn't I get the values username:password somewhere in the <strong>req</strong> object that comes from the callback ?
  How can I get those values without having to use <a href="http://senchalabs.github.com/connect/middleware-basicAuth.html" rel="noreferrer">Connect's basic http auth</a> ?</p>