title: How to fix this CORS issue in socket.io?
body: <p>I am trying to connect to a remote server with socket.io, but I am having some problems. I am getting this error: The value of the <code>Access-Control-Allow-Credentials</code> header in the response is ' ' which must be 'true' when the request's credentials mode is 'include'</p>
  <p>OK, so here is the code:</p>
  <p>Server</p>
  <pre class="lang-js prettyprint-override"><code>var server = require('http').createServer();
  
  const io = require(&quot;socket.io&quot;)(server, {
    cors: {
      origin: &quot;my URL&quot;,
      methods: [&quot;GET&quot;, &quot;POST&quot;],
      credentials: false
    }
  });
  
  
  io.sockets.on('connection', function(socket) {
      console.log(&quot;Client has connected!&quot;);
  });
  
  console.log ('Server started.');
  server.listen(3000);
  </code></pre>
  <p>Here is the client code:</p>
  <pre class="lang-js prettyprint-override"><code>var socket = io.connect(&quot;https://persistent-gentle-banon.glitch.me&quot;, {
    withCredentials: false
  });
  </code></pre>
  <p>How can I solve this and get it to connect?</p>
  <p>Thanks for any help!</p>