UNPKG

ip-restrictor

Version:

Easily allow or block internal IPs in Node.js and Express apps. A simple middleware for IP filtering and network security.

4 lines (2 loc) 127 B
const getClientIP = (req) => req.headers["x-forwarded-for"] || req.connection.remoteAddress; module.exports = getClientIP;