Export (0) Print
Expand All

Chapter 26 - Using Automatic Configuration, Automatic Proxy, and Automatic Detection

This chapter describes the automatic configuration, automatic proxy, and automatic detection features that make it possible, after Microsoft® Internet Explorer has been installed, to change settings globally without having to change each user's computer. The information in this chapter is particularly useful if you expect the needs of your organization or users to change, and you, therefore, anticipate frequent changes to browser settings.

Related Information in the Resource Kit

  • For more information about the administration of your Internet Explorer installations, see "Understanding Customization and Administration." 

  • For more information about building custom browser packages, see "Running the Microsoft Internet Explorer Customization Wizard"

  • For more information about tools and programs that can help you maintain Internet Explorer after deployment, see "Keeping Programs Updated." 

Using Automatic Configuration

Dd361918.spacer(en-us,TechNet.10).gif Dd361918.spacer(en-us,TechNet.10).gif

With automatic configuration, you can control browser settings on your users' computers from one central location. To use automatic configuration, you must create an IEAK Profile by using the IEAK Profile Manager. This profile consists of an auto-configuration .ins file and associated cabinet (.cab) files that contain information for configuring your users' browsers. You must then copy the .ins and .cab files to a server location that is accessible from your users' computers. For information about how to create an IEAK Profile by using the IEAK Profile Manager, see "Keeping Programs Updated" in this Resource Kit.

When you run the Internet Explorer Customization Wizard, you can set up automatic configuration for your custom browser packages.

To set up automatic configuration

  1. In Stage 4 on the Automatic Configuration page, select the Enable Automatic Configuration check box. 

  2. Specify the interval for how often automatic configuration will occur. 

  3. Type the location of the .ins file on your server. 

    Dd361918.ierk2601(en-us,TechNet.10).gif 

For more information about setting up automatic configuration when you run the Customization Wizard, see "Running the Microsoft Internet Explorer Customization Wizard" in this Resource Kit.

If you need to change browser settings later, you can simply use the IEAK Profile Manager to edit the .ins file, and then replace the existing .ins file on the server with your updated version. The next time your users start their browsers, or on a schedule that you specify, the configuration changes are reflected on each user's computer.

Using Automatic Proxy

Dd361918.spacer(en-us,TechNet.10).gif Dd361918.spacer(en-us,TechNet.10).gif

Automatic proxy (auto-proxy) makes system administration easier, because you can automatically configure proxy settings such as server addresses and bypass lists. When you use the IEAK Profile Manager to create your IEAK Profile for automatic configuration, you can specify standard proxy settings. These settings are then included in the .ins file that is used to automatically configure browser settings on your users' computers. For more information about how to create an IEAK Profile by using the IEAK Profile Manager, see "Keeping Programs Updated" in this Resource Kit.

To configure more advanced settings for auto-proxy, you can create a separate .js, .jvs, or .pac script file and then copy the file to a server location. Then, when you run the Internet Explorer Customization Wizard, you can specify the server location for the script file on the Automatic Configuration page. If you specify server locations for both automatic configuration and auto-proxy, the location of the auto-proxy script file is incorporated into the .ins file. For more information about setting up automatic proxy when you run the Customization Wizard, see "Running the Microsoft Internet Explorer Customization Wizard" in this Resource Kit.

The auto-proxy script file is executed whenever a network request is made. Within the script, you can configure multiple proxy servers for each protocol type; then, if a proxy server connection fails, Internet Explorer automatically attempts to connect to another proxy server that you have specified.

Proxy Selection and Proxy Bypass Lists

As an administrator, you can use a proxy server with a firewall to create a barrier between your organization and the Internet, to cache frequently used content, and to balance server load. You can specify the proxy server in the Internet Explorer Customization Wizard, in the IEAK Profile Manager, or through the browser. You can also restrict users' ability to change the proxy settings by using the Restrictions page in the Customization Wizard or in the IEAK Profile Manager.

The following procedure describes how to specify your proxy server and proxy bypass lists through the browser. For more information about performing these tasks by using the Customization Wizard or the IEAK Profile Manager, see "Running the Microsoft Internet Explorer Customization Wizard" or "Keeping Programs Updated" in this Resource Kit.

To specify your proxy server and proxy bypass settings through the browser

  1. In Internet Explorer, click the Tools menu, and then click Internet Options

  2. Click the Connections tab, and then click LAN Settings

    Dd361918.ierk2602(en-us,TechNet.10).gif 

  3. In the Proxy server area, select the Use a proxy server check box. 

  4. Type the Address and Port number for your proxy server. 

  5. If you want to assign different proxy server information for HTTP, Secure, FTP, Gopher, and Socks protocols, click Advanced, and then in the Proxy Settings page, fill in the proxy location and port number for each protocol. 

JavaScript or JScript Auto-proxy Examples

The following 10 scripts provide JavaScript or Microsoft® JScript® examples of how an auto-proxy configuration (.pac) file could be used to specify an auto-proxy URL. To use these examples, you must change the proxy server names, port numbers, and IP addresses.

Note The isInNet(), isResolvable(), and dnsResolve() functions query a DNS server. References to Object Model objects, properties, or methods cause the .pac file to fail silently. For example, the references window.open(...) and password(...) cause the .pac file to fail on Internet Explorer.

Example 1: Local hosts connect directly; all others connect through a proxy server.

The following function checks whether the host name is a local host, and if it is, whether the connection is direct. If the host name is not a local host, the connection is made through a proxy server.


function FindProxyForURL(url, host)
{ if (isPlainHostName(host))
return "DIRECT";
else
return "PROXY proxy:80";
}

The isPlainHostName() function checks whether there are any dots in the host name. If there are, it returns FALSE; otherwise, it returns TRUE.

Example 2: Hosts inside the firewall connect directly; outside local servers connect through a proxy server.

The following function checks whether the host name is a "plain" host name (meaning it does not contain the domain name) or part of a particular domain (.domain.com), and does not contain "www" or "home."


function FindProxyForURL(url, host)
{
if ((isPlainHostName(host) ||
dnsDomainIs(host, ".microsoft.com")) &&
!localHostOrDomainIs(host, "www.microsoft.com") &&
!localHostOrDomainIs(host, "home.microsoft.com"))
return "DIRECT";
else return "PROXY proxy:80";
}

Note The localHostOrDomainIs() function is executed only for URLs in the local domain. The dnsDomainIs() function returns TRUE if the domain of the host name matches the domain given.

Example 3: If host is resolvable, connect directly; otherwise, connect through a proxy server.

The following function asks the DNS server to resolve the host name passed to it. If it can resolve the host name, a direct connection is made. If it cannot resolve the host name, the connection is made through a proxy server. This function is useful if you use an internal DNS server to resolve all internal host names.


function FindProxyForURL(url, host)
{
if (isResolvable(host))
return "DIRECT";
else
return "PROXY proxy:80";
}

Example 4: If the host is in the specified subnet, connect directly; otherwise, connect through a proxy server.

The following function compares a given IP address pattern and mask with the host name. This is useful if certain hosts in a subnet should be connected directly and others should be connected through a proxy server.


function FindProxyForURL(url, host)
{
if (isInNet(host, "999.99.9.9", "255.0.255.0"))
return "DIRECT";
else
return "PROXY proxy:80";
}

The isInNet(host, pattern, mask) function returns TRUE if the host IP address matches the specified pattern. The mask indicates which part of the IP address to match (255=match, 0=ignore).

Example 5: Determine connection type based on host domain.

The following function specifies a direct connection if the host is local. If the host is not local, this function determines which proxy server to use based on the host domain. This is useful if the host domain name is one of the criteria for proxy server selection.


function FindProxyForURL(url, host)
{
if (isPlainHostName(host))
return "DIRECT";
else if (shExpMatch(host, "*.com"))
return "PROXY comproxy:80";
else if (shExpMatch(host, "*.edu"))
return "PROXY eduproxy:80";
else
return "PROXY proxy";
}

The shExpMatch(str, shexp) function returns TRUE if str matches the shexp using shell expression patterns.

Example 6: Determine connection type based on protocol being used.

The following function extracts the protocol being used and makes a proxy server selection accordingly. If no match is made for the protocol, a direct connection is made. This function is useful if the protocol being used is one of the criteria for proxy server selection.


function FindProxyForURL(url, host)
{
if (url.substring(0, 5) == "http:") {
return "PROXY proxy:80";
}
else if (url.substring(0, 4) == "ftp:") {
return "PROXY fproxy:80";
}
else if (url.substring(0, 7) == "gopher:") {
return "PROXY gproxy";
}
else if (url.substring(0, 6) == "https:") {
return "PROXY secproxy:8080";
}
else { 
return "DIRECT";
}
}

The substring() function extracts the specified number of characters from a string.

Example 7: Determine proxy setting by checking whether the host name matches the IP address.

The following function makes a proxy server selection by translating the host name into an IP address and comparing it to a specified string.


function FindProxyForURL(url, host)
{
if (dnsResolve(host) == "999.99.99.999") { 
// = http://secproxy return "PROXY secproxy:8080";
}
else { 
return "PROXY proxy:80";
}
}

The dnsResolve() function translates the host name into the numeric IP address.

Example 8: If the host IP matches the specified IP, connect through a proxy server; otherwise, connect directly.

The following function is another way to make a proxy server selection based on a specific IP address. Unlike Example 7, this one uses the function call to explicitly get the numeric IP address.


function FindProxyForURL(url, host)
{
if (myIpAddress() == "999.99.999.99") {
return "PROXY proxy:80"; }

else {
return "DIRECT";
}
}

The myIpAddress() function returns the IP address (in integer-dot format) of the host that the browser is running on.

Example 9: If there are any dots in the host name, connect through a proxy server; otherwise, connect directly.

The following function checks how many dots are in the host name. If there are any dots, the connection is made through a proxy server. If there are no dots, a direct connection is made. This is another way to determine connection types based on characteristics of the host name.


function FindProxyForURL(url, host)
{
if (dnsDomainLevels(host) > 0) { // if number of dots in host > 0 
return "PROXY proxy:80";
}
return "DIRECT";
}

The dnsDomainLevels() function returns an integer equal to the number of dots in the host name.

Example 10: Specify days of the week to connect through a proxy server; other days connect directly.

The following function determines the connection type by specifying the days of the week that are appropriate for a proxy server. Days that do not fall within these parameters use a direct connection. This function could be useful in situations where you might want to use a proxy server when traffic is heavy and allow a direct connection when traffic is light.


function FindProxyForURL(url, host)
{
if(weekdayRange("WED", "SAT", "GMT"))
return "PROXY proxy:80";
else
return "DIRECT";
}

The weekdayRange( <day1> [,<day2>] [,<GMT>] ) function returns whether the current system time falls within the range specified by the parameters <day1>, <day2>, and <GMT>. Only the first parameter is necessary. The GMT parameter sets the times to be taken in GMT rather than in the local time zone.

Note Where the function is called with <day1> == <day2>, previous versions of Internet Explorer would yield results different from results with Netscape Navigator. Specifically, previous versions of Internet Explorer would interpret this day range as an entire week, while Internet Explorer 6 and Netscape Navigator interpret the range as a single day. For example, if the current day is Monday, the call weekdayRange("TUE", "TUE") returns TRUE on previous versions of Internet Explorer and FALSE on Internet Explorer 6 and Netscape Navigator.

Using Automatic Detection

Dd361918.spacer(en-us,TechNet.10).gif Dd361918.spacer(en-us,TechNet.10).gif

The automatic detection feature enables automatic configuration and automatic proxy to work when a user connects to a network the first time. With automatic detection turned on, the browser is automatically configured when it is started, even if you did not customize the browser. For example, if a user downloads a non-customized browser from the Internet instead of installing a customized version from the corporate servers, automatic detection can automatically configure and customize the user's browser. This feature can help reduce administrative overhead and potentially reduce help desk calls about browser settings.

When you run the Internet Explorer Customization Wizard, you can turn on automatic detection of browser settings by selecting Automatically detect configuration settings on the Automatic Configuration screen. Automatic detection can also be set in the Internet Options dialog box of the Internet Explorer browser. For more information about turning on automatic detection for your custom browser packages, see "Running the Microsoft Internet Explorer Customization Wizard" in this Resource Kit.

Automatic detection of browser settings is based on Web Proxy AutoDiscovery (WPAD) and is supported by both Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS). With the appropriate settings, DHCP and DNS servers can automatically detect and configure a browser's settings. Your DHCP server must support the DHCPINFORM message; otherwise, use DNS. For details about setting up a DHCP or DNS server for automatic detection of browser settings, see "Setting Up Servers" in this Resource Kit.

Dd361918.spacer(en-us,TechNet.10).gif

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft