🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

forwarded

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forwarded

Parse HTTP X-Forwarded-For header

0.2.0
latest
Source
npm
Version published
Weekly downloads
35M
-4.56%
Maintainers
1
Weekly downloads
 
Created

What is forwarded?

The 'forwarded' npm package is designed to parse the 'X-Forwarded-For' header from an HTTP request, which is a standard header for identifying the originating IP address of a client connecting to a web server through an HTTP proxy or load balancer. This package extracts the IP addresses listed in the header and provides them in an array format, making it easier to handle cases where there are multiple proxies in use.

What are forwarded's main functionalities?

Parse X-Forwarded-For header

This feature allows you to parse the 'X-Forwarded-For' header from an HTTP request object and returns an array of IP addresses that were added by each proxy.

const forwarded = require('forwarded');
const req = { headers: { 'x-forwarded-for': '192.0.2.60, 198.51.100.17' } };
const ips = forwarded(req);
console.log(ips); // ['192.0.2.60', '198.51.100.17']

Other packages similar to forwarded

Keywords

x-forwarded-for

FAQs

Package last updated on 31 May 2021

Did you know?

Socket

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.

Install

Related posts