dos-protect

1.0.6 • Public • Published

dos-protect

Protect your Server from dos-attack

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 }

Installation

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

License

MIT

By Team EDII If you have any questions send us a mail at contact+dev@edii.in

Free Software

Package Sidebar

Install

npm i dos-protect

Weekly Downloads

0

Version

1.0.6

License

ISC

Unpacked Size

4.23 kB

Total Files

3

Last publish

Collaborators

  • teamedii