How to fix this CORS issue in

I am trying to connect to a remote server with, but I am having some problems. I am getting this error: The value of the Access-Control-Allow-Credentials header in the response is ’ ’ which must be ‘true’ when the request’s credentials mode is ‘include’

OK, so here is the code:


var server = require('http').createServer();

const io = require("")(server, {
  cors: {
    origin: "my URL",
    methods: ["GET", "POST"],
    credentials: false

io.sockets.on('connection', function(socket) {
    console.log("Client has connected!");

console.log ('Server started.');

Here is the client code:

var socket = io.connect("", {
  withCredentials: false

How can I solve this and get it to connect?

Thanks for any help!

Hey there @lando19! To properly answer your question, it’s important to know from which domain you are calling the final code snippet from. Let’s say I have a WebSocket server (or any web resource for that matter) running on, CORS ensures you cannot just use fetch('') if you are currently on So, where (most interestingly: on what domain) do you exactly implement the client code? Also, you can read more about what CORS means here.