dos-protect will protect your server from dos-attack
- To get started install the package by npm install dos-protect@latest
- Use it by the function : authenticateV1
Response code is sent: 200 for success and 429 for multiple request
Sample Code var protect=require('dos-protect');
var a=protect.authenticateV2('10.10.10.10',5,10); // Here 10.10.10.10 is IP Address, 5 is Max number of hits a API can take in specific timeAllowed(timeframe) , 10 is the timeAllowed(timeframe). You Can leave it blank in which case it will default to 5 hits in 5 seconds max.
if(a.status=='200){ //Success }
else{ //Error }
Sample Code (Old) var protect=require('dos-protect');
var a=protect.authenticateV1('10.10.10.10');
if(a.status=='200){ //Success }
else{ //Error }
dos-protect requires Node.js v6+ to run. dos-protect requires lodash and momentjs library.
Install the dependencies and devDependencies and start the server.
npm install dos-protect@latest
MIT
By Team EDII If you have any questions send us a mail at contact+dev@edii.in
Free Software