Skip to content

Instantly share code, notes, and snippets.

@rmrfslashbin
Last active May 2, 2023 03:31
Show Gist options
  • Save rmrfslashbin/dcd916d5fa4321f8560e182c19e69381 to your computer and use it in GitHub Desktop.
Save rmrfslashbin/dcd916d5fa4321f8560e182c19e69381 to your computer and use it in GitHub Desktop.
FoxyProxy: HOW-TO route all traffic through a proxy EXCEPT blacklisted domains.

FoxyProxy URL pattern filters.

This recipe sets up FoxyProxy to route all traffic through a proxy EXCEPT blacklisted domain (they will go out directly).

Assumptions

This receipe assumes a fresh FoxyProxy install, one proxy for everthing, excluding defined domains.

FoxyProxy Configuration

  • FoxyProxy should be set to Use proxies based on their pre-defined patterns and priorities.
  • Add a new proxy and configure the Proxy Details tab as needed.

URL Patterns

For the newly defined proxy, switch to the URL Patterns tab.

Everything

First, create a catch-all. All data will flow this proxy (whitelist).

  • Pattern Name: Everything (or whatever)
  • URL Pattern: *
  • Option: Whitelist
  • Option: Wildcards

Exclusion

Second, create a new pattern for each domain to NOT route (blacklist) through this proxy. Be sure to change example and com as needed in the URL Pattern field.

  • Pattern Name: example.com (or whatever)
  • URL Pattern: ^[A-Za-z]+:\/\/(?:[A-Za-z0-9-]+\.)*example\.com(?::[0-9]+)?\/.*
  • Option: Blacklist
  • Option: Regular expression

Repeat this set until all domains are listed. Save. Test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment