title: Error EADDRNOTAVAIL with Heroku nodejs server
body: <p>I have developped a nodejs server on OpenShift and I am now trying to make the same kind of server on Heroku for a new project.</p>
  
  <p>Here is a minimal code of my server:</p>
  
  <pre><code>var http = require('http');
  var port = process.env.PORT || 8080;
  var address = process.env.IP || '127.0.0.1';
  
  console.log(address);
  console.log(port);
  
  var server = http.createServer(function(req, res)
  {
      res.writeHead(200, { 'Content-Type': 'text/html', 'Access-Control-Allow-Origin': '*' });
      res.write(JSON.stringify({ valid: true }));
      res.end();
  });
  
  server.listen(port, address);
  </code></pre>
  
  <p>Differences with my OpenShift server are:</p>
  
  <ul>
  <li>The replacement of variables process.env.OPENSHIFT_NODEJS_PORT, process.env.OPENSHIFT_NODEJS_IP by process.env.PORT and process.env.IP.</li>
  <li>I set the IP variable with this command line: heroku config:set IP=MYSERVERADDRESS.com</li>
  </ul>
  
  <p>I cannot start my server, it always crash and I don't understand why, the logs of my server are:</p>
  
  <pre><code>MYSERVERADDRESS.com
  41184
  events.js:154
         throw er; // Unhandled 'error' event
     ^
   Error: listen EADDRNOTAVAIL MYSERVERIP:41184
       at Object.exports._errnoException (util.js:893:11)
       at exports._exceptionWithHostPort (util.js:916:20)
       at Server.__dirname.Server.Server._listen2 (net.js:1233:19)
       at net.js:1391:9
       at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:63:16)
       at listen (net.js:1282:10)
       at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:82:10)
  </code></pre>