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

request-filtering-agent

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

request-filtering-agent - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

4

lib/request-filtering-agent.js

@@ -98,3 +98,3 @@ "use strict";

// prevent twice apply
var appliedAgentSet = new Set();
var appliedAgentSet = new WeakSet();
/**

@@ -138,3 +138,3 @@ * Apply request filter to http(s).Agent instance

// Request with domain name
// Example: http://127.0.0.1.xip.io/
// Example: http://127.0.0.1.nip.io/
addDropFilterSocket(requestFilterOptions, socket);

@@ -141,0 +141,0 @@ return socket;

{
"name": "request-filtering-agent",
"version": "1.0.6",
"version": "1.0.7",
"description": "An http(s).Agent implementation that block request Private IP address.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/azu/request-filtering-agent",

@@ -53,16 +53,16 @@ # request-filtering-agent [![Actions Status](https://github.com/azu/request-filtering-agent/workflows/ci/badge.svg)](https://github.com/azu/request-filtering-agent/actions)

}).catch(err => {
console.err(err); // DNS lookup 127.0.0.1(family:4, host:127.0.0.1.xip.io) is not allowed. Because, It is private IP address.
console.err(err); // DNS lookup 127.0.0.1(family:4, host:127.0.0.1.nip.io) is not allowed. Because, It is private IP address.
});
```
`request-filtering-agent` support loopback domain like [xip.io](http://xip.io) and [nip.io](https://nip.io/).
`request-filtering-agent` support loopback domain like [nip.io](http://nip.io).
This library detects the IP address that is dns lookup-ed.
```
$ dig 127.0.0.1.xip.io
$ dig 127.0.0.1.nip.io
;127.0.0.1.xip.io. IN A
;127.0.0.1.nip.io. IN A
;; ANSWER SECTION:
127.0.0.1.xip.io. 300 IN A 127.0.0.1
127.0.0.1.nip.io. 300 IN A 127.0.0.1
```

@@ -75,7 +75,7 @@

const { useAgent } = require("request-filtering-agent");
const url = 'http://127.0.0.1.xip.io:8080/';
const url = 'http://127.0.0.1.nip.io:8080/';
fetch(url, {
agent: useAgent(url)
}).catch(err => {
console.err(err); // DNS lookup 127.0.0.1(family:4, host:127.0.0.1.xip.io) is not allowed. Because, It is private IP address.
console.err(err); // DNS lookup 127.0.0.1(family:4, host:127.0.0.1.nip.io) is not allowed. Because, It is private IP address.
});

@@ -82,0 +82,0 @@ ```

@@ -93,3 +93,3 @@ import * as net from "net";

// prevent twice apply
const appliedAgentSet = new Set<http.Agent | https.Agent>();
const appliedAgentSet = new WeakSet<http.Agent | https.Agent>();

@@ -138,3 +138,3 @@ /**

// Request with domain name
// Example: http://127.0.0.1.xip.io/
// Example: http://127.0.0.1.nip.io/
addDropFilterSocket(requestFilterOptions, socket);

@@ -141,0 +141,0 @@ return socket;

Sorry, the diff of this file is not supported yet

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