title: cross origin request blocked socket.io firefox
body: <p>I'm getting the following error in Firefox</p>
  
  <p>"Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <a href="http://localhost/socket.io/?EIO=3&amp;transport=polling&amp;t=1422586440181-21" rel="noreferrer">http://localhost/socket.io/?EIO=3&amp;transport=polling&amp;t=1422586440181-21</a>. This can be fixed by moving the resource to the same domain or enabling CORS."</p>
  
  <p>I checked these other stack overflow questions, but no success yet. Also note that io.set is not supported in the latest socket.io and my attempts at server configuration have failed.</p>
  
  <p><a href="https://stackoverflow.com/questions/24058157/socket-io-node-js-cross-origin-request-blocked">Socket.io + Node.js Cross-Origin Request Blocked</a></p>
  
  <p><a href="https://stackoverflow.com/questions/15771805/how-to-set-socket-io-origins-to-restrict-connections-to-one-url/21711242#21711242">how to set socket.io origins to restrict connections to one url</a></p>
  
  <p><a href="https://stackoverflow.com/questions/25504851/how-to-enable-cors-on-firefox">How to enable CORS on Firefox?</a></p>
  
  <p>and I have tried adding these statements to my server:</p>
  
  <pre><code>io.origins('http://localhost:3002')
  
  app.use(function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    next();
  </code></pre>