Node.js + Socket.io | Set custom headers on the server
问题 I use Helmet with Express to set quite some security HTTP headers from the server side. This is nicely done, when rendering client pages on top of the node.js app, using: var app = express(); app.use(helmet()); .. res.render("pages/index", data); All the resources on the index page will have the Helmet headers. Unfortunately, socket.io does its own header management. So, anything that comes after /socket.io/ will have insecure/its own headers. For example here: <https_path>/socket.io/socket