title: Making an HTTP request using node.js throws EAFNOSUPPORT
body: <p>I'm trying to make a simple HTTP GET request using node.js, but I'm running into trouble using node.js v0.3.4-pre (i.e. compiled from HEAD as of this morning). Here's my code:</p>
  
  <pre><code>    var cli = require('cli');
      var http = require('http');
      var url = require('url');
  
      cli.parse();
  
      cli.main(function(args, opts) {
              this.debug(args[0]);
  
              var siteUrl = url.parse(args[0]);
              var site = http.createClient(siteUrl.port, siteUrl.host);
              console.log(siteUrl);
  
              var request = site.request("GET", siteUrl.pathname, {'host' : siteUrl.host})
              request.end();
  
              request.on('response', function(response) {
                      response.setEncoding('utf8');
                      console.log('STATUS: ' + response.statusCode);
                      response.on('data', function(chunk) {
                              console.log("DATA: " + chunk);
                      });
              });
      });
  </code></pre>
  
  <p>Here's the error that I get:</p>
  
  <pre><code>node.js:68
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
  Error: EAFNOSUPPORT, Address family not supported by protocol family
      at doConnect (net.js:499:19)
      at Client.connect (net.js:652:30)
      at Client._ensureConnection (http.js:1033:10)
      at Client.request (http.js:1048:8)
      at Object.&lt;anonymous&gt; (/Users/paul/Desktop/readify.js:16:21)
      at /usr/local/lib/node/.npm/cli/0.2.3-2/package/cli.js:995:18
      at Object.main (/usr/local/lib/node/.npm/cli/0.2.3-2/package/cli.js:1000:9)
      at Object.&lt;anonymous&gt; (/Users/paul/Desktop/readify.js:10:5)
      at Module._compile (node.js:359:32)
      at Object..js (node.js:367:14)
  </code></pre>