I'm currently trying to find a solution to someone spamming my webpage via socket.io with a for loop containing millions of calls to emit an arbitrary event to my server. So far I've managed to identify those sockets which are spamming and prevent them from being processed further with middleware.
However, in the middleware, once a socket is flagged, I disconnect the socket via socket.disconnect(true), but that doesn't seem to stop the barrage of incoming messages. It seems the the socket.disconnect event only fires once all incoming events have been delt with. Anyone familiar with Socket.io, node.js, and express? I would need to be able to stop the barrage on my server witihin the io class.