New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

proxy-out

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxy-out

Override HTTP and HTTPS to set global proxy out settings

latest
Source
npmnpm
Version
0.0.13
Version published
Maintainers
1
Created
Source

proxy-out

Installation

To use, simply require at any point before making your outgoing HTTP or HTTPS requests (Generally at the top of your server JS):

require('proxy-out')('http://my.proxy.com:80');

Requiring proxy-out will override your http.request, http.get, https.request and https.get methods to route through your proxy. This is useful if you're working in a corporate space, behind a corporate proxy.

Whitelisting

Sometimes, you'll want to route to internal destinations and won't want them running through a proxy (A proxy won't know how to get back to your localhost, for instance). In this situation, you can add a whitelist by supplying the hostnames as an array like so:

var whitelist = ['localhost', '127.0.0.1', 'my-site.local'];
require('proxy-out')('http://my.proxy.com:80', whitelist);

Testing

Testing actually attempts to connect to an external site (Google.com), so you'll need a working proxy. By default, test.js checks for the environment variable http_proxy.

export http_proxy=http://my.proxy.com:80
npm test

FAQs

Package last updated on 18 Dec 2014

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