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 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:
Server
var server = require('http').createServer();
const io = require("socket.io")(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.');
server.listen(3000);
Here is the client code:
var socket = io.connect("https://persistent-gentle-banon.glitch.me", {
withCredentials: false
});
How can I solve this and get it to connect?
Thanks for any help!