Socket
Socket
Sign inDemoInstall

@fastify/forwarded

Package Overview
Dependencies
0
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @fastify/forwarded

Parse HTTP X-Forwarded-For header


Version published
Weekly downloads
13K
increased by4.96%
Maintainers
3
Install size
4.82 kB
Created
Weekly downloads
 

Readme

Source

@fastify/forwarded

CI NPM version js-standard-style

Parse HTTP X-Forwarded-For header.

Updated version of the great https://github.com/jshttp/forwarded. Implements https://github.com/jshttp/forwarded/pull/9.

Installation

$ npm i @fastify/forwarded

API

var forwarded = require('@fastify/forwarded')

forwarded(req)

var addresses = forwarded(req)

Parse the X-Forwarded-For header from the request. Returns an array of the addresses, including the socket address for the req, in reverse order (i.e. index 0 is the socket address and the last index is the furthest address, typically the end-user).

Testing

$ npm test

License

MIT

Keywords

FAQs

Last updated on 05 Dec 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc