Checks if a url should be proxied

Usage no npm install needed!

<script type="module">
  import shouldProxy from '';



should-proxy uses a no_proxy list formatted like so localhost,,,,, 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


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

var result = shouldProxy("", {
  no_proxy: ""
// Should be false, because is on the no_proxy list provided
console.log("", 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"]