socket.io icon indicating copy to clipboard operation
socket.io copied to clipboard

What is expected if CORS object is empty while initialisation?

Open arpitkapoor97 opened this issue 11 months ago • 0 comments

Discussed in https://github.com/socketio/socket.io/discussions/5272

Originally posted by arpitkapoor97 January 1, 2025 Consider below scenarios, when I am trying to connect a client from a different PORT/URL.

` const app = express(); const server = createServer(app);

const io = new Server(server); // This gives CORS error const io = new Server(server, {}); // This also gives CORS error

const io = new Server(server, { cors: {} });`

// This gives no CORS error. WHY?

PS: I am experimenting this on code spaces so it might behave differently.

arpitkapoor97 avatar Jan 01 '25 07:01 arpitkapoor97