在 Firefox 中逐个选项卡禁用/启用代理

Ric*_*ich 26 firefox proxy firefox-extensions browser-tabs

是否可以在 Firefox 中逐个选项卡禁用/启用代理连接?

我可以在启用代理的情况下访问互联网,我可以在禁用代理的情况下访问我们的内部服务器,但两种配置都不允许另一个。

我有一种感觉,Firefox 4 的每个选项卡配置文件可能允许这样做,但想知道是否有办法在 Firefox 3.6.13 上实现这一点,也许是通过使用扩展。

对于我正在做的那一刻quickProxy(不QuickProxy它同时试图找到quickProxy我刚刚发现),这让我打开和关闭代理整个浏览器,但我们更希望一些更精致。

Joe*_*nte 6

再次投票给FoxyProxy ,但如果您的设置很复杂,我建议使用PAC功能。我有两个代理服务器可供选择,但有时选择哪一个会变得非常棘手。为了设置 FoxyProxy 以使用 PAC,请转到选项Proxy Details卡并选择Automatic Proxy Configuration URL并输入类似file:///home/me/.myproxy.pac. 以下是 PAC 文件的示例:

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;
}
Run Code Online (Sandbox Code Playgroud)

请注意,上面的示例效率相当低,因为它通常会为每个 HTTP 连接在 myproxy.company.com 上进行 DNS 查找;AT_HOME我在启动时通过外部程序将和硬编码AT_WORK到 .pac 文件中。但这是一个示例,说明如果需要,您可以使 PAC 脚本变得多么复杂。


小智 5

我最近发现这个 FireFox 扩展可能对你有用:

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

这似乎允许您为每个容器配置一个代理,并且您当然可以根据需要将一个或多个选项卡附加到容器。

  • 我认为这是针对OP提出的问题最有效、最好的解决方案。 (2认同)
  • 没有麻烦。效果很好。 (2认同)

Grz*_*zki -3

看看FoxyProxy。它有多个配置选项。不太确定它是否允许配置每个选项卡,但绝对可以为不同的地址配置不同的代理设置。通过这种方式,您可以为内部服务器设置一个代理(可能是一些网络掩码,如 192.168.0.0/24),并为 Internet 设置另一个代理。