Answers for "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:6001/socket.io/?EIO=3&transport=polling&t=NRZ3xyq. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)"

6

socket io with cors

const io = require("socket.io")(httpServer, 
  { 
  cors: {    
    origin: "*",    
    methods: ["GET", "POST"]  
  }});
Posted by: Guest on December-25-2020
1

socket.io cors

const io = require("socket.io")(httpServer, {  cors: {    origin: "http://localhost:8080",    methods: ["GET", "POST"]  }});httpServer.listen(3000);
Posted by: Guest on November-30-2020

Code answers related to "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:6001/socket.io/?EIO=3&transport=polling&t=NRZ3xyq. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)"

Code answers related to "Javascript"

Browse Popular Code Answers by Language