In Express.js, req.ips is a string array of addresses from the X-Forwarded-For header when trust proxy is enabled. If trust proxy is off (the default) or the header is missing, it is [].
Use it behind reverse proxies or load balancers to inspect the hop list. For a single client IP, prefer req.ip. Configure trust with app.set('trust proxy', …).
Syntax
Read req.ips in your Express.js route handler. Start with this line.
Express
req.ips
Call
What it does
req.ips
Primary signature.
Install with npm install express. Create the app with const app = express() before you use this API in an Express.js tutorial project.
GET /
Header: X-Forwarded-For: 203.0.113.10, 198.51.100.2
client: 203.0.113.10
chain: [ '203.0.113.10', '198.51.100.2' ]
→ Response body: ok
How It Works
Trust once at startup. Middleware and routes then share the same proxy rules.
Middleware runs first. Every request logs before the route handler.
req.ip is the selected client. Use it for “who called?” summaries.
req.ips is the full chain. Keep it for hop-level debugging, then call next().
Compatibility
Runtime Support
req.ips is an Express.js request property. It runs on a Node.js server (Express 5 needs Node.js 18+). Browsers do not execute it — they only send HTTP requests to your app.
✓ Server · Express 4 & 5
req.ips
Works wherever Express runs: Node.js is the primary target. Bun and Deno can run many Express apps with compatibility layers. Not available in the browser.
ServerNode.js runtime API
Node.js18+ for Express 5 · 14+ typical for Express 4
Supported
BunExpress-compatible server apps
Supported
DenoVia npm compatibility / adapters
Supported
req.ipsExpress on Node.js
Bottom line: Study and run these examples with Node.js and the express package. Copy a snippet into a local file and start the server with node.
Frequently Asked Questions
It is a string array of IP addresses from the X-Forwarded-For header when trust proxy is enabled. Otherwise it is an empty array.
trust proxy defaults to false. Without enabling it (or without an X-Forwarded-For header), Express leaves req.ips empty.
req.ip is one selected client IP. req.ips is the full forwarded chain from X-Forwarded-For when proxies are trusted.
For X-Forwarded-For: client, proxy1, proxy2, Express reports ["client", "proxy1", "proxy2"], where proxy2 is the furthest downstream hop.
No. It is a server-side request property. Browsers only send HTTP requests; your Express app reads req.ips on the server.