Socket
Socket
Sign inDemoInstall

@fastify/forwarded

Package Overview
Dependencies
0
Maintainers
13
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
9.8K
increased by31.88%
Maintainers
13
Install size
4.93 kB
Created
Weekly downloads
 

Readme

Source

@fastifyjs/forwarded

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 install @fastifyjs/forwarded

API

var forwarded = require('@fastifyjs/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 12 Feb 2021

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