Pac File Bypass Proxy For Local Addresses

Table Of Contents

  1. Pac File Bypass Proxy For Local Addresses Online
  2. Pac File Bypass Proxy For Local Addresses Free
  3. Proxy.pac Bypass Local Addresses

AutoConfigUrl: (Mon Jun 10 02:24:29 PM) proxy auto-configuration script could not be downloaded (Mon Jun 10 02:24:29 PM) Falling back to DIRECT/NOPROXY. Setting WINHTTPACCESSTYPENAMEDPROXY flag in WINHTTPAUTOPROXYOPTIONS dwAccessType. How are proxy settings set in the Ubuntu gnome environment. These methods are not full proof and can break the configuration of the system. Making the network behave in an undesired way.


Proxy Auto-Config Files

Overview

Proxy Auto-Configuration (PAC) is a method used by Web browsers to select a proxy for a given URL. The method for choosing a proxy is written as a JavaScript function contained in a PAC file. This file can be hosted locally or on a network. Browsers can be configured to use the file either manually or, in Microsoft Windows environments, automatically using Group Policy Objects. This appendix explains the basics of using PAC files.

How PAC Files Work

A PAC file is referenced each time a new URL is loaded. The host, for example cnn.com, the URL, for example cnn.com/images/logo.jpg, and other information such as the local machine IP address can be evaluated and rules based on this information used to determine whether to send the traffic via a proxy or direct to the Internet.

The following example compares the URL requested by the user, with the URL ipcheckit.com/data/. If the URLs match, the PAC file will instruct the browser to send the request direct to the Internet. This can be used if you need to exception a section of a Web site from going via the Web Scanning Services; if the user had requested only ipcheckit.com, this rule would not apply:

In the next example the local IP address of the machine making a Web request is evaluated. If the IP address falls within the IP address range 10.10.1.* then the PAC file will send the request to proxy182.scansafe.net. If this proxy is unavailable it will then failover to proxy137.scansafe.net. This can be used if you have different office locations using different IP address ranges with a Web Scanning Services proxy or Connector specific to each location:

Although a PAC file can have any name, normally it should be called proxy.pac.

PAC File Deployment

There are three ways to deploy a PAC file:

•Local PAC: in some cases it may be appropriate to host the file on the local machine, this can be useful if the machine is likely to leave the network and doesn't have Anywhere+ installed. Rules can be specified in the PAC file to allow direct Internet access when off-network.

•Share PAC: the file can be hosted on a Windows share, assuming that the share is accessible to the machine and that the correct permissions have been applied. If the location of the PAC file is password protected then this is likely to prevent the browser from downloading the file.

•Hosted PAC: hosting the file on a Web server is the most popular and widely supported method. The only requirement is that the file be served by the Web server with a specific MIME type (application/x-ns-proxy-autoconfig).

Basic PAC File Examples

Direct all traffic through the first proxy. If it is unreachable, use the second proxy. If both are unavailable go direct:

Direct HTTP traffic as in the first example, but send all HTTPS traffic direct:

Direct all traffic as in the first example, but send traffic for a given domain direct:

If the client computer is on the specified internal network, go through the proxy. Otherwise go direct:

Example PAC File

Manually Configure a Browser to Use a PAC File

With Firefox, in the Tools menu click Options. Click the Network tab then click Settings. Click Automatic Proxy Configuration URL. Enter the URL of the PAC file in the box then click OK to save the settings.

With Internet Explorer, in the Tools menu click Internet Options. Click the Connections tab then click LAN settings. Select 'Use automatic configuration script'. Enter the URL of the PAC file in the box then click OK to save the settings.

With Opera, in the Tools menu click Preferences. Click the Advanced tab then, in the left panel, click Network. Click Proxy Servers and select 'use automatic proxy configuration'. Enter the URL of the PAC file in the box then click OK to save the settings.

With Safari for Windows, in the Edit menu click Preferences. Click the Advanced tab then click Change settings. Click LAN settings. Select 'Use automatic configuration script'. Enter the URL of the PAC file in the box then click OK to save the settings.

Windows Network Share Hosted PAC Files

It is possible to host a PAC file on a Windows network share by using a VBScript to copy it to the local machine. This can be integrated with Windows logon scripting.

Step 1 Set a share directory on a file server that everyone has access to.

Step 2 Create the proxy.pac file in the shared directory.

Online

Step 3 Create a script.vbs file to copy the proxy.pac file from the network share to the local machine, for example:

Note Logon scripts run with the same permissions as the logged-on user, and may not have write permission for the root of C:. Ensure the VBScript copies the PAC file to a location where the user has write permission. However, the PAC file should be write-protected to prevent users changing it.

Step 4 Open the Active Directory Users and Computers control panel.

Step 5 View the properties of the OU or Domain for which you want to apply the Group Policy.

Step 6 Edit the Group Policy.

Step 7 In the User Configuration area, expand Windows Settings and click Scripts (Logon/Logoff).

Step 8 Add a Logon Script.

Step 9 Browse to find the script.vbs file you created earlier, then click OK.

Table B-1 Local PAC URL Syntax

Windows XP
MacOS X

Internet Explorer

Firefox

Safari

Opera


Table B-2 Share PAC URL Syntax

Windows XP
MacOS X

Internet Explorer

Firefox

Safari

Opera


When a number of computers reside on a single network, especially in a corporate setting a Proxy Server is often installed to provide a secure and efficient way of providing Internet access.

A Proxy Server basically sits at the boundary of a network and provides Internet access by allowing the client computers to talk directly to it whilst it heads off to the Internet to retrieve content.

The browsers need to be pointed at this proxy server in order for the connection to work and although having a single proxy server is fairly easy to configure by simply either it’s IP address or DNS address in the Browser settings page, configuring multiple clients for multiple Proxy servers can become very complicated very quickly.

A Proxy Pac File is a configuration file that instructs the Browser which Proxy Server it needs to use in order to get to a certain destination (usually the Internet).

When combined with smart distribution and configuration techniques such as Active Directory, PAC files can be a very powerful tool.

Writing an advanced Proxy Pac File can be both time consuming and frustrating. The following is an example of an advanced Proxy Pac File that is capable of using a number of different Proxy Server addresses depending on both the source IP of the client and the destination. There are a number of additional factors to take into account when using this Proxy Pac File, particularly around the use of the myIpAddress function which is known to have mixed results around both incorrectly using the local loop back address (127.0.0.1) and IPv6 when installed. In my experience, this file has worked without problem – but your mileage may vary.

Pac File Bypass Proxy For Local Addresses Online

The main backbone of the Proxy Pac File is built around using the Javascript logical operators AND (&&) / OR (||) (double click to select all for copy/paste).

Pac File Bypass Proxy For Local Addresses Free

[sourcecode language=”plain”]
// Advanced Proxy PAC File
// Please feel free to copy, paste and edit as much as you like!function FindProxyForURL(url, host)
{// *** Proxy Pac File checks local IP to see if it is in the 192.168.10.0/24 network ***
if (
isInNet(myIpAddress(), '192.168.10.0', '255.255.255.0') &&
(
// *** Proxy Pac File then checks to see if the destination address is in any of the following addresses ***
shExpMatch (host, '10.10.10.*') ||
shExpMatch (host, '10.10.20.*') ||
shExpMatch (host, '10.10.30.*') ||
dnsDomainIs (host, '.corporate')
)
)
// *** Proxy Pac File then sets the Proxy Server as the following Proxy Server address and port ***
{return 'PROXY proxy1.proxypacfile.com:8080';}// *** Proxy Pac File checks local IP to see if it is in the 192.168.20.0/24 network ***
if (
isInNet(myIpAddress(), '192.168.20.0', '255.255.255.0') &&
(
// *** Proxy Pac File then checks to see if the destination address is in any of the following addresses ***
shExpMatch (host, '10.10.10.*') ||
shExpMatch (host, '10.10.20.*') ||
shExpMatch (host, '10.10.30.*') ||
dnsDomainIs (host, '.corporate')
)
)
// *** Proxy Pac File then sets the Proxy Server as the following Proxy Server address and port ***
{return 'PROXY proxy2.proxypacfile.com:8080';}// *** Proxy Pac File checks local IP to see if it is in the 192.168.30.0/24 network ***
if (
isInNet(myIpAddress(), '192.168.30.0', '255.255.255.0') &&
(
// *** Proxy Pac File then checks to see if the destination address is in any of the following addresses ***
shExpMatch (host, '10.10.10.*') ||
shExpMatch (host, '10.10.20.*') ||
shExpMatch (host, '10.10.30.*') ||
dnsDomainIs (host, '.corporate')
)
)
// *** Proxy Pac File then sets the Proxy Server as the following Proxy Server address and port ***
{return 'PROXY proxy3.proxypacfile.com:8080';}// *** Proxy PAC File checks the following destination addresses regardless of client IP ***
if (
shExpMatch (host, '172.16.10.*.*') ||
shExpMatch (host, '172.16.20.*.*') ||
shExpMatch (host, '172.16.30.*.*')
)
// *** Proxy Pac File then sets the Proxy Server as the following Proxy Server address and port ***
{return 'PROXY proxy4.proxypacfile.com:8080';}// *** Proxy Pac File checks the following destination addresses regardless of client IP ***
if (
dnsDomainIs (host, '.internal') ||
dnsDomainIs (host, '.local') ||
dnsDomainIs (host, '.intranet')
)
// *** Proxy Pac File then sets the Proxy Server as Direct which will bypass all Proxy Servers ***
{return 'DIRECT';}// *** Proxy Pac File will set the global Proxy Server in the event that no other conditions are met ***
else
{return 'PROXY globalproxy.proxypacfile.com:8080';}
}
[/sourcecode]

Proxy.pac Bypass Local Addresses