# should-proxy

> Checks if a url should be proxied

Latest version **1.0.4** (published 2015-09-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install should-proxy
pnpm add should-proxy
yarn add should-proxy
bun add should-proxy
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2015-09-10 |
| First published | 2015-09-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | John Andersen |
| Maintainers | pdxjohnny |
| Keywords | proxy, no_proxy, no-proxy |

## Links

- npm: https://www.npmjs.com/package/should-proxy
- Repository: https://github.com/pdxjohnny/should-proxy
- Homepage: https://github.com/pdxjohnny/should-proxy#readme
- Issues: https://github.com/pdxjohnny/should-proxy/issues
- npm.io page: https://npm.io/package/should-proxy

## Recent versions

- 1.0.4 (latest) — 2015-09-10
- 1.0.3 — 2015-09-10
- 1.0.1 — 2015-09-09
- 1.0.0 — 2015-09-09

## README

#should-proxy

should-proxy uses a no_proxy list formatted like so
`localhost,127.0.0.0/8,10.0.0.0/8,192.168.0.0/16,172.16.0.0/12,.internal.com`
To determine if a url should be proxied or not.

should-proxy is a function that takes a url as well as options.
If no options are provided should-proxy uses the environment variable `no_proxy`

Usage
---

```javascript
var shouldProxy = require('should-proxy');

var result = shouldProxy("http://something.google.com/", {
  no_proxy: "google.com"
});
// Should be false, because google.com is on the no_proxy list provided
console.log("http://something.google.com/", result);

result = shouldProxy("http://localhost/", {
  no_proxy: ""
});
// Should be true, because localhost is not the no_proxy list provided
console.log("http://localhost/", result);

// Omitting the options object will cause should-proxy
// to use process.env["no_proxy"]
```

---
_Source: https://npm.io/package/should-proxy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
