title: No Access-Control-Allow-Origin header is present on the requested resource node.js
body: <p>I have a problem when trying to communicate with my node.js server from ajax requests.</p>
  
  <p>I have configured my server like this :</p>
  
  <pre><code>var allowCrossDomain = function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type,      Accept");
    next();
  };
  
  app.use(allowCrossDomain);
  </code></pre>
  
  <p>When doing my requests I have this error : </p>
  
  <pre><code>XMLHttpRequest cannot load http://10.192.122.180:8181/meters. No 'Access-Control-Allow-     Origin' header is present on the requested resource. Origin 'http://localhost:6161' is  therefore not allowed access.
  </code></pre>
  
  <p>When I type URL in a browser it works. I have read many things about CORS, same origin policy but now I'm quite lost.</p>
  
  <p>Could someone help me please ?</p>
  
  <p>Thanks.</p>