title: Node.js Error: connect ECONNREFUSED
body: <p>I am new to node and running into this error on a simple tutorial.</p>
  
  <p>I am on the OS X 10.8.2 trying this from CodeRunner and the Terminal.
  I have also tried putting my module in the <code>node_modules</code> folder.</p>
  
  <p>I can tell this is some kind of connection problem but I have no idea why?</p>
  
  <pre><code>events.js:71
          throw arguments[1]; // Unhandled 'error' event
                         ^
  Error: connect ECONNREFUSED
      at errnoException (net.js:770:11)
      at Object.afterConnect [as oncomplete] (net.js:761:19)
  </code></pre>
  
  <p>app.js:</p>
  
  <pre><code>var makeRequest = require('./make_request');
  
  makeRequest("Here's looking at you, kid");
  makeRequest("Hello, this is dog");
  </code></pre>
  
  <p>make_request.js:</p>
  
  <pre><code>var http = require('http');
  
  var makeRequest = function(message) {
  
      //var message = "Here's looking at you, kid.";
      var options = {
          host: 'localhost', port: 8080, path:'/', method: 'POST'
      }
  
      var request = http.request(options, function(response) {
          response.on('data', function(data) {
              console.log(data);
          });
      });
      request.write(message);
      request.end();
  };
  
  module.exports = makeRequest;
  </code></pre>