Using Proxy Auto Configuration contents.gifprev1.gifnext1.gif

Using Proxy Auto Configuration

Introduction.

Proxy Auto Configuration is a system for configuring browser proxies for Networked machines. What is allows you to do is have one proxy setup file on the network, saving individual configuration of client machines. This is especially suitable for WinGate networks, as once the clients machines are setup, only one machine needs configuration. The Proxy Auto Config file is a special format file that can reside anywhere on the shared network. When setup correctly, it allows dynamic assignment of proxy servers and ports.

Setting up the PAC file.

The PAC file is in JAVA. Dont worry, you dont need to know Java to be able to configure these files.

The standard file format is just a text file like this.

function FindProxyForURL(url, host)

{

if (url.substring(0, 5) == "http:") {

return "PROXY wingate:80";

}

else if (url.substring(0, 4) == "ftp:") {

return "PROXY wingate:80";

}

else if (url.substring(0, 6) == "https:") {

return "PROXY wingate:80";

}

else {

return "PROXY wingate:1080";

}

}

As you can see it is fairly self explanatory. This file should be called wgproxy.pac or similar. What the code says is

if (url.substring(0, 5) == "http:") {return "PROXY wingate:80";

If the first 5 letters of the URL are "http:" then tell the browser to use wingate on port 80. It is easy to tell the browser when not to use a proxy with a line such as

if (url.substring(0, 15) == "http://localbox") {return "DIRECT";}

For more details on the format and available commands, see http://home.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html

If you are using the suggested ports and name for your WinGate services then you will not need to change anything in the above file.

Network and Client setup.

Setting up the Auto config is as simple as placing the PAC file in the root directory of any shared machine on the network. To refer to this file machines have to have their browsers set to use the Automatic Proxy Configuration file. This is accessed in most browsers via the preferences/network menu. The browser wants a URL, so if you want to serve the file from network disk then you should use the following method.

If the computers network name is say server then you would type \\server\c\proxy.pac (with out the quotes) into the URL edit box. The double \\s mean network, the c is the drive, and proxy.pac is the file.