Socket
Socket
Sign inDemoInstall

proxy-addr

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxy-addr

Determine address of proxied request


Version published
Weekly downloads
27M
decreased by-1.09%
Maintainers
1
Weekly downloads
 
Created

What is proxy-addr?

The proxy-addr npm package is used to determine the IP address of the client connected to your web server through an HTTP proxy or a load balancer. It provides functionality to derive the client's IP address considering the X-Forwarded-For header and other well-known headers that can be used to indicate the actual client IP address when proxying HTTP requests.

What are proxy-addr's main functionalities?

Determine client IP address from request

This feature allows you to get the client's IP address from an incoming HTTP request object, considering the list of addresses specified by the 'trust' parameter.

const proxyaddr = require('proxy-addr');
const requestIp = proxyaddr(req, trust);

Compile trusted address list

This feature compiles an array of trusted addresses into a function, which can then be used to check if a given IP should be trusted.

const proxyaddr = require('proxy-addr');
const trust = proxyaddr.compile(['loopback', 'linklocal', 'uniquelocal']);

Check if an address is trusted

This feature checks if a given IP address is in the list of trusted addresses.

const proxyaddr = require('proxy-addr');
const trust = proxyaddr.compile('10.0.0.1');
const trusted = trust('10.0.0.1');

Other packages similar to proxy-addr

Keywords

FAQs

Package last updated on 24 Feb 2020

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc