Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

proxy-addr

Package Overview
Dependencies
Maintainers
6
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxy-addr - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

5

HISTORY.md

@@ -0,1 +1,6 @@

1.0.3 / 2014-09-21
==================
* Use `forwarded` npm module
1.0.2 / 2014-09-18

@@ -2,0 +7,0 @@ ==================

13

index.js

@@ -19,2 +19,3 @@ /*!

var forwarded = require('forwarded');
var ipaddr = require('ipaddr.js');

@@ -50,13 +51,5 @@

function alladdrs(req, trust) {
if (!req) {
throw new TypeError('req argument is required');
}
// get addresses
var addrs = forwarded(req);
var proxyAddrs = (req.headers['x-forwarded-for'] || '')
.split(/ *, */)
.filter(Boolean)
.reverse();
var socketAddr = req.connection.remoteAddress;
var addrs = [socketAddr].concat(proxyAddrs);
if (!trust) {

@@ -63,0 +56,0 @@ // Return all addresses

{
"name": "proxy-addr",
"description": "Determine address of proxied request",
"version": "1.0.2",
"version": "1.0.3",
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",

@@ -14,2 +14,3 @@ "license": "MIT",

"dependencies": {
"forwarded": "~0.1.0",
"ipaddr.js": "0.1.3"

@@ -16,0 +17,0 @@ },

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