Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-ipfilter

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-ipfilter - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

20

package.json
{
"name": "express-ipfilter",
"version": "1.1.1",
"version": "1.1.2",
"description": "A light-weight IP address based filtering system",

@@ -13,5 +13,5 @@ "keywords": [

],
"repository": "https://github.com/casz/express-ipfilter",
"repository": "https://github.com/jetersen/express-ipfilter",
"license": "MIT",
"author": "casz",
"author": "jetersen",
"main": "index.js",

@@ -35,8 +35,6 @@ "types": "index.d.ts",

"*.js": [
"eslint --fix",
"git add"
"eslint --fix"
],
"*.{json,css,md}": [
"prettier --write",
"git add"
"prettier --write"
]

@@ -96,6 +94,6 @@ },

"eslint-plugin-prettier": "^3.0.1",
"husky": "^3.0.0",
"jest": "^24.7.1",
"lint-staged": "^9.0.0",
"prettier": "^1.16.4"
"husky": "^4.0.0",
"jest": "^25.1.0",
"lint-staged": "^10.0.0",
"prettier": "^2.0.1"
},

@@ -102,0 +100,0 @@ "engines": {

@@ -80,2 +80,21 @@ # express-ipfilter: A light-weight IP address based filtering system

Using wildcard ip ranges and nginx forwarding:
```javascript
let whitelist_ips = ['10.1.*.*', '123.??.34.8*'] // matches '10.1.76.32' and '123.77.34.89'
let clientIp = function(req, res) {
return req.headers['x-forwarded-for'] ? (req.headers['x-forwarded-for']).split(',')[0] : ""
}
app.use(
ipFilter({
id: clientIp,
forbidden: 'You are not authorized to access this page.',
strict: false,
filter: whitelist_ips,
})
)
```
## Error Handling

@@ -82,0 +101,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc