GitHub - flancast90/ExileJS: A comprehensive banning/blacklisting library for no...
source link: https://github.com/flancast90/ExileJS
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
ExileJS
A comprehensive banning library for NodeJS applications.
What Makes ExileJS Different?
Unlike other traditional banning softwares, ExileJS is unique in the fact that it uses browser fingerprints to ban users, as oppossed to the normal IP ban. This simple change not only makes ExileJS more modern than the other softwares, but also more effective, since it will not be confused by VPN's, proxies, or even Incognito tabs!
You think I'm lying? Test it out, and understand why EcileJS is truly next-gen!
Install
NPM Package
$ npm install exile-js
Dependencies
$ npm install express-fingerprint
Usage
- Create a text file named
blacklist.txt
in the same directory as your node.jsserver
file. - Add the below lines to your node.js
server
file
const exile = require('exile-js'); // dependency initialisation var Fingerprint = require('express-fingerprint') // We will store user fingerprint here var userid; app.use(Fingerprint({ parameters:[ // Defaults Fingerprint.useragent, Fingerprint.acceptHeaders, Fingerprint.geoip, ] })) app.get('*',function(req,res,next) { userid = req.fingerprint.hash; })
Accepted Args
// bans a user given their browser fingerprint, // which is obtained the first time the user goes to the site. exile.ban(userId); // checks if a user is banned or not. exile.check(userId); // unbans a previously banned user. exile.unban(userId);
License
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK