we want our server to block any messages containing data larger than 7 kb.
our server code:
socket.on('startdata', function (data) { console.log(data.text);});
our client code:
socket.emit('startdata', { text: 'testtext blah blah' });
Is there a way to check the size of the data and refuse to accept the message before passing the data to socket.on ?
source share