Skip to content

redis storage for not overlapping ip ranges with check ability

Notifications You must be signed in to change notification settings

yarsky-tgz/redis-ip-ranges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redis-ip-ranges

redis storage for not overlapping ip ranges with check ability

Installation

npm i redis-ip-ranges

Usage

const redis = require('redis');
const RedisIpRanges = require('./dist');
const client = redis.createClient();
const rangesHandler = new RedisIpRanges(client, 'proxies');

(async () => {
  await rangesHandler.insertBulk(['127.0.0.1', '10.0.0.0/8']);
  console.log(await rangesHandler.check('127.0.0.1')); //true
  console.log(await rangesHandler.check('10.10.128.1')); //true
  console.log(await rangesHandler.check('127.0.0.2')); //false
  console.log(await rangesHandler.check('8.8.8.8')); //false
})();

About

redis storage for not overlapping ip ranges with check ability

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published