flood-protection
Flood protection for realtime applications
- This library is a direct implementation of Token Bucket Algorithm.
- I basically rewrote the python solution which was stated here for my own needs in javascript: https://stackoverflow.com/a/668327/1417536.
Install
npm install --save flood-protection
Usage
; const floodProtection = rate: 5 // default: 5, unit: messages // IMPORTANT: rate must be >= 1 (greater than or equal to 1) per: 8 // default: 8, unit: seconds ;
Basic Example
; // ...// io is a Socket.io instance... io;
LICENCE
MIT (c) 2017 Mehmet Yatkı