简体   繁体   中英

should i parse Socket.IO messages on server on client

We have a chat implemented with nodejs+socket.io and now we want to add a profanity check that will basically iterate over an array of bad works and check if they exists in the message.

Based on the profanity check we want to put a html element over the message saying "this message contains profanity, do you want to read it?". The answer will be remembered. Also will have a checkbox saying "always show messages containing profanity"

We have a pretty large number of users (I don't have the approximate count of messages / minute) that are chatting constantly (about 3-400 online at any hour) and we expect that number to rapidly increase over this year (3-4x). So should we implement the profanity check on the server or on the client ?

It would be a better idea to do it on the server side. If scaling is something you have on your mind then you can always use the cluster module to take advantages of the multi-cores. The latency should be minimal in this case, supporting concurrency to the tune of ~850 users/second

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM