HTTP X-Forwarded-For Header Parser

JSON →
library 0.2.0 ·javascript maintenance
verified May 27, 2026

The `forwarded` package is a minimalist Node.js utility designed to robustly parse the `X-Forwarded-For` HTTP header. It extracts a list of IP addresses from the request, including the direct socket address, and returns them in reverse proxy order, where index `0` represents the immediate client (the socket address) and the last index is the furthest origin (typically the end-user's IP). This is crucial for applications running behind proxies or load balancers, where `req.ip` or `req.connection.remoteAddress` would only reflect the proxy's IP. The current stable version is 0.2.0, released in May 2021. Being part of the `jshttp` organization, `forwarded` adheres to a philosophy of creating small, single-purpose, and highly performant modules. Its release cadence is exceptionally slow, with only four releases since its initial launch in 2014, which underscores its stability and the mature nature of its functionality. It has no external runtime dependencies, making it a lightweight and reliable choice for foundational HTTP parsing tasks.

total hits 12
actors 4 distinct systems
last hit 5d ago AhrefsBot
MetaBot
4
GPTBot
2
Script
1
Humans
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇬🇧 United Kingdom · BD