Home > Article > Backend Development > How does the websocket server written by swoole limit the flow of a certain client?
For example, after a certain client connects to my websocket server, it keeps sending me spam messages. I want to set it so that the client can only send a message to the websocket server once in ten seconds. How to do this? Is this implemented using code in the server-side script written by swoole or is it prevented at other levels?
For example, after a certain client connects to my websocket server, it keeps sending me spam messages. I want to set it so that the client can only send a message to the websocket server once in ten seconds. How to do this? Is this implemented using code in the server-side script written by swoole or is it prevented at other levels?
DDOS protection cannot be placed on the handler. Think about it, no matter how you process the information sent by the client or filter it, the information has actually been passed to your program and has occupied the resources of the handler. This has achieved the goal of the DDOS attacker.
DDOS protection should at least be done at the firewall level, blocking at the network entrance instead of blocking in the processing program.
tag.
Next article:Please tell me how to use regular expressions to extract the numbers in thetag.