title: node express server doesnt respond on ajax
body: <p>I am new to node.js and got stuck on cors problem. I am sending client ajax get request from one express server to another, but at least I am not able to get response from <code>app.all('*', function(req, res, next){console.log("request: "+req)})</code> 
  GET request looks something like: </p>
  
  <pre><code>$.ajax({
      type: 'GET',
      url: 'http://localhost:8082/request'
  });
  </code></pre>
  
  <p>I was also setting headers in ajax with:</p>
  
  <pre><code>'beforeSend : function(xhr) {
      xhr.setRequestHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS');
      xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
      xhr.setRequestHeader('Access-Control-Max-Age', '1000');
      xhr.setRequestHeader('Authorization', '*')},
  </code></pre>
  
  <p>...or setting cors module in node.js:</p>
  
  <pre><code>var cors = require('cors');
  var app = express();
  app.use(cors());
  app.options('*',cors(),function(){
  console.log("preflight")
  });
  </code></pre>
  
  <p>In both firefox and chrome, I received no response (in chrome I got <code>net::ERR_CONNECTION_REFUSED</code> )
  When running node servers locally on my PC, everything works. Also curl command works fine.
  Is there a chance, this is a problem with hosting/ports or am I still missing something?</p>