Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Rechercher dans l’assistance

Évitez les escroqueries à l’assistance. Nous ne vous demanderons jamais d’appeler ou d’envoyer un SMS à un numéro de téléphone ou de partager des informations personnelles. Veuillez signaler toute activité suspecte en utilisant l’option « Signaler un abus ».

Learn More

Automatic redirect in pac files doesn't work

  • 1 réponse
  • 0 a ce problème
  • 7 vues
  • Dernière réponse par Mike Kaply

more options

Hello,

I have a problem with a pac file in our org. We download it from a server. The basic functionality is applied and it does redirect the desired traffic to the proxy. The problem occurs when the proxy goes down, it then should automaticaly start making direct connections, but the connections fail. We want to proxy only http and https and event that with some exceptions.

It was done according to https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file#example_6

Is there any problem with PAC file or does the browser have issues with the config?

Thanks for any help.

function FindProxyForURL(url, host) {

   /* Our proxy list */
   OURPROXY = "PROXY 172.22.59.X:3128; DIRECT"
   INOUR = "ourgroup.internal"
   /* Normalize the URL and HOST for pattern matching */
   url = url.toLowerCase();
   host = host.toLowerCase();
   /* Our Network Entry */
   if (isResolvable(INOUR)) {
       /* Don't proxy local services */
       if (isInNet(host, "10.0.0.0", "255.0.0.0")
       ) {
           return "DIRECT";
       }
       /* Proxy only http & https */
       if (url.substring(0, 5) == "http:" || url.substring(0, 6) == "https:") {
           /* Don't proxy local hostnames (without dots) */
           if (isPlainHostName(host)) {
               return "DIRECT";
           }
           /* END: Don't proxy local hostnames */
           /* START: Internal systems */
           if (shExpMatch(host, "*.example.com") ||
               shExpMatch(host, "example.com") ||
               /* END: Internal systems */
               /* START: Split VPN tunnel */
               shExpMatch(host, "*.example2.com") ||
               shExpMatch(host, "example2.com") ||
               /* END: Split VPN tunnel */
           ) {
               return "DIRECT";
           }
           /* END: Don't proxy to internal systems */
           return OURPROXY;
       } else {
         return "DIRECT";
       }
       /* END: Proxy only http & https */
   } else {
     return "DIRECT";
   }
   /* END: Our Network Entry */
   return "DIRECT";

}

Hello, I have a problem with a pac file in our org. We download it from a server. The basic functionality is applied and it does redirect the desired traffic to the proxy. The problem occurs when the proxy goes down, it then should automaticaly start making direct connections, but the connections fail. We want to proxy only http and https and event that with some exceptions. It was done according to https://developer.mozilla.org/en-US/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file#example_6 Is there any problem with PAC file or does the browser have issues with the config? Thanks for any help. function FindProxyForURL(url, host) { /* Our proxy list */ OURPROXY = "PROXY 172.22.59.X:3128; DIRECT" INOUR = "ourgroup.internal" /* Normalize the URL and HOST for pattern matching */ url = url.toLowerCase(); host = host.toLowerCase(); /* Our Network Entry */ if (isResolvable(INOUR)) { /* Don't proxy local services */ if (isInNet(host, "10.0.0.0", "255.0.0.0") ) { return "DIRECT"; } /* Proxy only http & https */ if (url.substring(0, 5) == "http:" || url.substring(0, 6) == "https:") { /* Don't proxy local hostnames (without dots) */ if (isPlainHostName(host)) { return "DIRECT"; } /* END: Don't proxy local hostnames */ /* START: Internal systems */ if (shExpMatch(host, "*.example.com") || shExpMatch(host, "example.com") || /* END: Internal systems */ /* START: Split VPN tunnel */ shExpMatch(host, "*.example2.com") || shExpMatch(host, "example2.com") || /* END: Split VPN tunnel */ ) { return "DIRECT"; } /* END: Don't proxy to internal systems */ return OURPROXY; } else { return "DIRECT"; } /* END: Proxy only http & https */ } else { return "DIRECT"; } /* END: Our Network Entry */ return "DIRECT"; }

Toutes les réponses (1)

more options

Unfortunately I don't have a lot of experience with PAC files.

This might be a better question for our enterprise mailing list

https://groups.google.com/a/mozilla.org/g/enterprise