title: CORS issue in (Nodejs + Angular 6 + socket.io)
body: <p>We are facing CORS issue in Angular 6 using socket.io client when we are trying to connect to the server.</p>
  
  <p>The error we are getting in the console of browser.</p>
  
  <pre><code>Access to XMLHttpRequest at 'http://********.com/socket.io/?EIO=3&amp;transport=polling&amp;t=N3jTiAZ' from origin 'http://localhost:4200' has been blocked by CORS policy: 
  
  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'.
  
   The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
  </code></pre>
  
  <p>Here is the server code </p>
  
  <pre><code>const express = require('express');
  const bodyParser = require('body-parser');
  const app = express();
  const server = require('http').createServer(app);
  const conn = app.listen("3000")
  const io = require('socket.io').listen(conn);
  
  io.origins('*:*') 
  
  var connectioncheck = io.of('/check-connection');
  connectioncheck.on('connection', function (socket) {
     console.log('user  connected');
  });
  </code></pre>
  
  <p>Here is frontend code using simple html and js </p>
  
  <pre><code>   &lt;script src="https://cdn.jsdelivr.net/npm/socket.io-client@2/dist/socket.io.js"&gt;&lt;/script&gt;
  var socket = io.connect('http://********.com/check-connection');
  socket.emit('connection', "hello",function(db){
          console.log(db);
          console.log("data from callback");
      });
  </code></pre>