30

Is it possible to disable/enable the proxy connection on a tab-by-tab basis in Firefox?

I can access the internet with the proxy enabled, and I can access our internal servers with the proxy disabled, but neither configuration allows the other.

I have a feeling that Firefox 4's per tab profiles may permit this, but was wondering whether there was a way to achieve this on Firefox 3.6.13, perhaps through the use of an extension.

For the moment I'm making do with quickProxy (not QuickProxy which I've just discovered while trying to find quickProxy) which allows me to switch the proxy on and off for the whole browser, but would prefer something more fine-grained.

2
  • 6
    The answers thus far seem rather lame. To my limited knowledge, foxyproxy(which everybody suggests) doesn't operate on a per tab basis. Of the three answers so far I haven't seen any state whether they answer the question of per tab , I suspect that they don't. Perhaps a route to a solution would be if you can run different profiles in different tabs, and each profile is configured for a different proxy. foxyproxy may be ok as an alternative if you can't get exactly what you want but it's not what your question asks for(unless it does do different tabs which it probably doesn't).
    – barlop
    Feb 26, 2011 at 17:28
  • Not a tab-by-tab solution but firefox Add-on "MM3-ProxySwitch" gives you an icon to toggle between direct/proxy with a single click. The icon turns gray when proxying is off to visually let you know the current state. The config file is kind of cryptic but something as short as this does the above toggle "[Direct ] [Privoxy http=myrouterip:8118 ssl=myrouterip:8118 noProxy=localhost, 127.0.0.1 ]"
    – yoyoma2
    Oct 12, 2017 at 2:13

7 Answers 7

8

I recently discover this FireFox extension that might work for you:

https://addons.mozilla.org/en-US/firefox/addon/container-proxy/

this seems to allow you to configure a proxy per-container and you can certainly attach one or more tabs to the container as needed.

2
  • 2
    I think this is the most effective and best solution for the problem posed by the OP. Jan 25, 2020 at 14:51
  • 2
    No hassles. Worked perfectly. Nov 24, 2020 at 7:18
6

Another vote for FoxyProxy but I'll suggest using the PAC feature if your setup is complex. I have two proxy servers to choose from, but which one to choose gets very tricky sometimes. In order to setup FoxyProxy to use the PAC, go to the Proxy Details tab and select Automatic Proxy Configuration URL and enter something like file:///home/me/.myproxy.pac. Here's an example of a PAC file:

function FindProxyForURL(url, host)
{
   var DIRECT = "DIRECT";
   var PROXY = "PROXY myproxy.company.com:80";
   var LOCAL = "PROXY localhost:8118";

   var rc = "";

// alert("My IP Address is: " + myIpAddress());

   // special: DIRECT / localhost
   if (dnsResolve(host) == "127.0.0.1") {
      rc = DIRECT;
   }

   // special: DIRECT / plain name (no domain name (i.e. no dots)) (e.g. http://foobar)
   // (must be local to where I'm at)
   else if (isPlainHostName(host)) {
      rc = DIRECT;
   }

   else {
      // special: LOCAL / not at home & restricted hosts
      if ((dnsDomainIs(host, "frank.home.com")) ||
          (dnsDomainIs(host, "firewall.home.com")) ||
          (dnsDomainIs(host, "backupserver.home.com"))) {
         // determine if we're at home or not; home can resolve the laser printer
         var AT_HOME = (isResolvable("myprinter.home.com") ? true : false);

         if (! AT_HOME) {
            rc = LOCAL;
         }
         else {
            rc = DIRECT;
         }
      }

      // general: DIRECT / not at work
      else {
         // determine if we're at work or not; work can resolve proxy server
         var AT_WORK = (isResolvable("myproxy.company.com") ? true : false);
         if (! AT_WORK) {
            rc = DIRECT;
         }

         // ASSUMED: AT_WORK

         // special: LOCAL / at work & broken work links
         // (must use local proxy server to connect)
         else if ((host == "download.company.com") ||
                  (host == "search.company.com") ||
                  (host == "www.company.com")) {
            rc = LOCAL;
         }

         // general: DIRECT / at work & work intranet links
         else if ((dnsDomainIs(host, ".company.com")) ||
                  (dnsDomainIs(host, ".companylocal.com")) ||
                  (dnsDomainIs(host, ".legacycompany.com"))) {
            rc = DIRECT;
         }

         // general: DIRECT / at work & 192.168.*
         else if (isInNet(host, "192.168.0.0", "255.255.0.0")) {
            rc = DIRECT;
         }

         // default: go through LOCAL
         else {
            rc = LOCAL;
         }
      }
   }

//   alert("Proxy for {" + host + "} is: " + rc);
   return rc;
}

Note that the above example is fairly inefficient as it will usually wind up with a DNS lookup on myproxy.company.com for every single HTTP connection; I hard-code AT_HOME and AT_WORK in the .pac file via an external program at boot time. But it's an example of how complicated you can make your PAC script, if you need to.

0

If you use proxies by patterns you can create a list of IP addresses and it will automatically switch to the proxy

1
  • Please expand your answer with supporting information Oct 9, 2022 at 22:51
-2

Why do you need the proxy on a per-tab basis? Does your dev environment reroute google.com to a LAN box or something?

Would it be good enough to automatically use the proxy for external sites (http://superuser.com), and not for internal sites (http://uri.to/internal/server)? If so then I'd say look into Joe's post about the PAC feature.

The "No proxy for:" box in the network configuration screen (that's what it's called in FF4 at least, I don't have FF3 installed here) is a way to do some of the same things without creating a PAC file. You can have it ignore your proxy for http://www.local.org, http://www2.local.org and 127.0.0.1 by using something like .local.org, 127.0.0.1

2
  • Here's one scenario. If your domain's DNS is configured using a set geographical rules then you will need per-tab basis proxy to test each region to see if the appropriate DNS results is being returned.
    – James Wong
    Oct 29, 2014 at 2:45
  • Asker stated that he needed to use proxy to access external sites, and no proxy to access internal sites. Proxy per-tab is not needed for this. "No Proxy for:" setting is exactly for this purpose. (As an example, I put localhost, 10.0/8 to use no proxy for accessing localhost and 10.*.*.*)
    – aff
    Mar 10, 2015 at 7:09
-3

Take a look at FoxyProxy. It has multiple configuration options. Not quite sure if it allows for configuring per-tab, but definitely can configure different proxy settings for different addresses. This way you could set up one proxy for internal servers (probably some network mask like 192.168.0.0/24) and another one for the Internet.

-3

I have been using FoxyProxy since a month as an add-on to Firefox and I am very much satisfied with its options. With this add-on you can configure multiple proxies; then add the URLs as White-list for the proxy you want it to use. Use wild cards when there are more matching URLs.

For e.g., you have Proxy1 and Proxy2, you want all Microsoft URLs to go through Proxy1 and all others to use Proxy2.

Here is what you need to do:

Edit the Default Proxy and give Proxy2 IP and port. Do not add any URL Pattern Create a Proxy as Proxy1 and give Proxy1 IP and port. In the URL Pattern add "*.microsoft.com*" (without quotes) as white-list. Then set FoxyProxy to "Use proxies based on their pre-defined patterns and priorities"

Hope this helps.

-3

for anybody who is looking for a way... try SwitchyOmega a firefox extension

https://addons.mozilla.org/en-US/firefox/addon/switchyomega/

1
  • It does not work on the tab level. The proxy is changed browser-wide.
    – ᄂ ᄀ
    May 1, 2019 at 9:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .