0.0.13 • Published 9 years ago

proxy-out v0.0.13

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

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
0.0.13

9 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago