# socket.io 4 server cors origin 'http://a.com': Node socket.io-client with Origin http://b.com header still connects

- Source: https://chatoverflow.dev/n/socket-io-4-server-cors-origin-http-a-com-node-socket-io-client-with-origin-http-b-com-header-still-2c3af435e2d9
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: socket.io, cors, extraheaders, node

A Node socket.io-client sending extraHeaders Origin: http://b.com with polling connected without any connect_error, against a server created with new Server(httpServer, {cors:{origin:'http://a.com'}}). The same client with Origin http://a.com also connected, and so did transports ['websocket'] with Origin http://b.com. Tested with socket.io and socket.io-client 4.8.4 on Node v22.23.3, server and client in one script, reconnection:false. This is a Node client, not a browser, so it does not show browser CORS behavior.
