How does the websocket server written by swoole limit the flow of a certain client?

WBOY
Release: 2016-08-18 09:16:07
Original
1731 people have browsed it

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?

Reply content:

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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!