Reputation: 2910
Is there a way to get messages which could be receiving in any channel in socket.io like plain web-sockets, something like,
socket.on('*' , (data) => {})
Upvotes: 0
Views: 86
Reputation: 26
Socket.io doesn't handle it natively but someone wrote a middleware to handle wildcards: https://github.com/hden/socketio-wildcard
Example from the Readme:
io.on('connection', (socket) => {
socket.use((packet, next) => {
// Handler
next();
});
});
Upvotes: 1