Skip to content

simple, fast and lightweight PHP script to rate limit accesses. Run in memory to improve performance

Notifications You must be signed in to change notification settings

pdropi/anti-DOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

anti-DOS

Simple, fast and lightweight PHP script to rate limit accesses. Run in memory (shmop) to improve performance

Approach with shmop worked faster than with redis and memcached.

It's multipurpose. It can be used for rate limit based on ip, user agent, among other parameters.

Default limits hits per second or microsecond per ip to prevent DOS (Denial Of Service) attack.

Usage:

Just include or require anti_DOS.php file in the top of your main php file (like index.php) or resource file being abused and configure parameters $intervalo (check interval), $qtd_max (rate limit) and $tempo_bloqueio (block time) to adjust according to the desired limits. eg:

<?php
include_once('/home/yoursite/anti_DOS.php');

About

simple, fast and lightweight PHP script to rate limit accesses. Run in memory to improve performance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages