How to use req and res inside socket express.js
module.exports = function (io) { io.use(function(socket, next){ if (socket.handshake.query &&