javascript - how to bind middleware to events in socket.io -


right can bind middleware io.use(middleware);, triggered when socket connection made. there way intercept before passing event handle in expressjs?

in other word....

in express.js can do:

app.get('/', middleware1, middleware2, function(req, res){     res.end();  }); 

can same in socket.io?

socket.on('someevent', middleware1, middleware2, function(data){     console.log(data); // data filtered 2 previous middlewares }); 


Comments