
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Check client ip for koa & express.
npm install ip-checker
to install ip-checker
;
var express = require('express')
, app = express();
app.use(require('ip-checker')({
default: '*',
allow: ['127.0.0.1']
}));
app.listen(3000)
var app = require('koa')()
app.use(require('ip-checker')({
default: '*',
allow: ['127.0.0.1'],
mode: 'koa'
}))
app.listen(3000)
curl -H 'x-forwarded-for: 127.0.0.2' -i http://localhost:3000/
curl -H 'x-forwarded-for: 127.0.0.1' -i http://localhost:3000/
Name | Description | Default value |
---|---|---|
default | Action for unknown ip. * for allow all unknown ips, x for block all unknown ips. | * |
checker | A string or function to check request ip. Return allow string to allow request, block string to block request, empty string to tell ip-checker it's an unknown request | x-forwarded-for |
disable | Disable ip-checker or not. | false |
allow | A string array that means request is allowed if client ip is in this set. | [] |
block | A string array that means request is blocked if client ip is in this set. | [] |
mode | express or koa mode. | express |
emitter | You can emit a disable event with a bool value to switch disable value. | |
process.env.IP_CHECKER_DEBUG | Set this value to true to show debug log | |
FAQs
Check client ip for koa & express.
We found that ip-checker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.