title: How do I bind local ipv6 address to my node.js program?
body: <p>I just created this simple program in nodejs, but i can't bind it to the ipv6 address of my NIC.</p>
  
  <p>I read in the API docs the following</p>
  
  <p><strong>localAddress: Local interface to bind for network connections.</strong></p>
  
  <pre><code>var http = require('http');
  
  var options = {
    hostname: 'www.whatismyipv6.com',
    localAddress: '2a01:xxxx:xxxx:xxxx::2' //a real ipv6 address here
  };
  
  var req = http.request(options, function(res) {
    res.on('data', function (chunk) {
      console.log(chunk.toString());
    });
  });
  
  req.on('error', function(e) {
    console.log('ERROR: ' + e.message);
  });
  
  req.end();
  </code></pre>
  
  <p>But when i execute the program i get this. Note the ipv4 address.</p>
  
  <pre><code>&lt;head&gt;
  &lt;title&gt;WhatIsMyIPv6? (IPv4: xx.xx.xxx.xxx)&lt;/title&gt;
  &lt;meta name="bitly-verification" content="984886d337a6"/&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>It looks like nodejs is ignoring the localAddress and is binding directly to the ipv4 address.</p>
  
  <pre><code># node --version
  v0.8.0
  </code></pre>