Skip to content

spddl/ip-range-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expressjs Middleware Block or Allow IP Range

without dependencies

Getting Started

const IPRange = require('ip-range-middleware')

Usage

Allow only 127.0.0.1

app.use(IPRange([
  [127], [0], [0], [1]
]))

Allow only the range from 192.168.178.1 to 192.168.178.128

app.use(IPRange([
  [192], [168], [178], [1, 128]
]))

Allow only two addresses

app.use(IPRange([
  [[192], [168], [178], [2]],
  [[127], [0], [0], [1]]
]))

Allow only ::1

app.use(IPRange([], { allow: ['::1'] }))

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published