title: socket.io, 'Access-Control-Allow-Origin' error
body: <p>I have set up a node server with socket io turning and trying to connect to it through another server.
  However some browsers on different computers give me this error and makes it reconnect the whole time:</p>
  
  <p>XMLHttpRequest cannot load <a href="https://serverDomain.net:3000/socket.io/?EIO=3&amp;transport=polling&amp;t=Lo_SdiU" rel="noreferrer">https://serverDomain.net:3000/socket.io/?EIO=3&amp;transport=polling&amp;t=Lo_SdiU</a>. The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin '<a href="https://www.differentServerDomain.fr" rel="noreferrer">https://www.differentServerDomain.fr</a>' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.</p>
  
  <p>my js config:</p>
  
  <pre><code>var port = 3000;
  var fs = require('fs');
  var https = require('https');
  var express = require('express');
  var app = express();
  
  var options = {
      key: fs.readFileSync('/etc/letsencrypt/live/devpeter.net/privkey.pem'),
      cert: fs.readFileSync('/etc/letsencrypt/live/devpeter.net/fullchain.pem')
  };
  var server = https.createServer(options, app);
  var io = require('socket.io')(server);
  io.origins('https://www.differentServerDomain.fr:* https://www.differentServerDomain.fr/wp-admin/index.php:*');
  
  // start of server
  server.listen(port, function(){
      console.log('listening on *: '+ port + "\n");
  });
  </code></pre>
  
  <p>I am using node 8.0 and socket io 2.2,
  Your help will be greatly appreciated.</p>
  
  <p>EDIT:
  here is the client code:</p>
  
  <pre><code>&lt;script src="https://serverDomain.net:3000/socket.io/socket.io.js"&gt;&lt;/script&gt;
  &lt;script&gt;
     var socket = io('https://serverDomain.net:3000');
  &lt;/script&gt;
  </code></pre>