Node.js Module to Guard Web-Site with fastify and rate-limiter-captcha
This module is a hybrid of fastify and several rate-limiter modules. shorter codes and more realistic ddos protection will be here. This place is still under construction. so please be understanding. Thank you users. If you want to contact me, instagram : marijua.cpp
npm i rate-limiter-captcha
request module as a dependency is compulsory.
# Pin the request version npm install --save request
In this section, we will write which port we will listen to. short and concise code
const limiter = require('rate-limiter-captcha'); limiter.listen(1337);
In this section, we write the content and extension of the 'port we listen to' of the website.
const limiter = require('rate-limiter-captcha'); limiter.listen(1337); limiter.page('/about','About us bla bla bla...');
Here, we actually get rid of long lines. As
rate-limiter-captcha we have not come to our core yet. We are inspired by several places. but here we shorten our codes quite a bit. and we fully comply with the concept of
Here, the first parameter is how many total requests can be sent in 1 minute? will be the answer to your question. we say 10 as an example.
const limiter = require('rate-limiter-captcha'); limiter.basicRateLimiter(10); // 10 is max request for 1 minute. ' 1 MİNUTE !!! '