How to use Automatic Configuration Scripts for Proxy Settings


  • Question
    How does one use the Automatic Configuration Scripts for Proxy settings?

  • Answer

    It may sometimes be necessary for the browser to pick up proxy settings from a configuration file, which is a simple text file saved as the PROXY.PAC file
    This file, as well as holding proxy settings can also be used for other situations, such as as load-balancing, fault tolerance, etc.
    The example shown here is for the basic concept.

    There are many modifications that may be applied for the PROXY.PAC file.
    In this following example multiple URLs are defined in order to bypass the proxy, and all the other URLs are defined to get through the proxy.

    function FindProxyForURL(url, host)
    {
       var proxy_yes = "PROXY 192.168.100.29:8080";
       var proxy_no = "DIRECT";
       if (shExpMatch(url, "http://www.finjan.com*")) { return proxy_no; }
       if (shExpMatch(url, "http://www.mycompany.com*")) { return proxy_no; }
       // Proxy anything else
       return proxy_yes;   
    }

    Here are examples for configuring these settings on the 3 most common browsers. Once the configuration file is created, follow the procedures below for each of the broswers:

    Netscape Navigator:

    1. Copy the PROXY.PAC file to the C:\directory, or other directory of your choice.
    2. In the browser proxy settings, configure Automatic Proxy Configuration to
              file:///c|/proxy.pac
    3. Click on Reload button.



    Internet Explorer

    1. Copy the PROXY.PAC file to the C:\directory, or other directory of your choice.
    2. In the browser proxy settings, configure Use Automatic Configuration Script URL to
           file://c:/proxy.pac



    Mozilla FireFox  

    1. Copy the PROXY.PAC file to the C:\directory, or other directory of your choice.
    2. In the browser proxy settings, configure Automatic proxy Configuration URL to
           file:///c:/proxy.pac
    3. Click on Reload button.





  • This article applies to:
    NG 1000
    NG 5000
    NG 8000
    This article was previously published as:
    Finjan KB 1163

    Last Modified 3/23/2009.
    https://support.trustwave.com/kb/KnowledgebaseArticle13120.aspx