WinINet and WinHTTP IPv6 Support in Web Proxy Auto-Discovery (WPAD) scripts enabled in Windows Vista

07/18/2006

4 minutes to read

In this article

Hi, my name is Jonathan Silvera and I am the WinINet and WinHTTP Program Manager. Today I would like to talk to you about changes we have made to add IPv6 support in the WinINet and WinHTTP WPAD helper functions.

The explosion of the Internet in the late 1990’s has caused an unexpected scarcity of IPv4 addresses, with the pool depleting on a daily basis. IPv6 provides a solution to this problem and although it is currently not widely deployed, its use will definitely become more prevalent in the future. WPAD is a protocol that allows web clients to automatically detect what the correct proxy configuration should be for their outgoing traffic. This is very useful for corporate deployments because it allows IT administrators to setup complex scripts that can route traffic for all clients to specific proxies based on the target server the clients are attempting to connect to. WinINet and WinHTTP support WPAD helper functions as defined by the Navigator Proxy Auto-Config (PAC) File Format specification, which has become a defacto standard. Unfortunately this specification was written in 1996 and does not define what the function behaviors should be when a WPAD script is deployed in an IPv6 capable network.

Here at Microsoft we are aware that IPv6 is the wave of the future and as part of a Windows wide push, we have required that all of our components support dual stack (IPv4 and IPv6) and IPv6 only networks. The first customer to approach us asking for IPv6 support in WPAD was our internal IT department after encountering issues with the IPv4 script dependency of their current deployment. When designing a solution to enable this scenario for Windows Vista, our team recognized the importance of providing a backwards compatible solution for IT administrators in order to avoid breaking the large number of existing corporate deployments with IPv4 script dependencies.

In order to meet our customer’s needs and support IPv6 without affecting existing deployment, we have added 6 new helper class functions as an extension to the Navigator Proxy Auto-Config (PAC) File Format specification and also added a new IPv6 capable function called FindProxyForURLEx that administrators can implement in the WPAD script.

New Proxy Helper API Definitons:

In order to take advantage of the IPv6 enabled functions, IT administrators must define within their WPAD script a function called FindProxyForURLEx (url, host) which will replace the legacy FindProxyForUrl (url, host) function. Only from the new FindProxyForURLEx function will administrators be able to execute the new functions.

We also attempted to simplify work for developers, by aligning our functions to return different types of IP addresses in the same order of preference as other networking components, specifically IPv6 addresses followed by IPv4 addresses (i.e. current behavior for Winsock’s getaddrinfo(..) function).

The following tables explain the differences between the new WPAD helper functions and the legacy WPAD helper functions. The new functions are marked with a *

Functions Input Output Reason for Change dnsResolve Host IPv4 address Ex function will return a list of IPv6/IPv4. Necessary since IPv6 or IPv4 addresses can have multiple unicast addresses for a single interface dnsResolveEx* Host List of IPv6/IPv4 addresses

Functions Input Output Reason for change isResolvable IPv4 host TRUE / FALSE The Ex function will return TRUE if a host can resolve to an IPv6 or IPv4 address. The legacy function only returns TRUE if the host resolves to an IPv4 address isResolvableEx* IPv6/IPv4 host TRUE / FALSE

Functions Input Output Reason for change myIPAddress none IPv4 address Ex function will return a list of IPv6/IPv4. Necessary since IPv6 or IPv4 addresses can have multiple unicast addresses for a single interface myIPAddressEx* none List of IPv6/IPv4 addresses

Functions Input Output Reason for change isInNet Host, Dot separated IP address pattern, IP address Mask TRUE / FALSE Provide an IP version agnostic way to find if an IP address is in a given subnet. Also, the mask notation in IPv4 is deprecated. isInNetEx* IP AddressIP Prefix TRUE / FALSE

Functions Input Output Reason for change sortIPAddressList* List of IPv6/IPv4 addresses Sorted List of IPv6/IPv4 addresseslist of IPv6/IPv4 addresses There is no counterpart legacy function because legacy functions only returned a single IPv4 address, therefore there was no need to sort

Functions Input Output Reason for change getClientVersion* None WPAD engine version number Currently this function returns version 1.0. We added this function to allow IT administrators to update their WPAD to work with different versions of the WPAD engine without causing breaks to their existent deployment.

Again, see the extension spec for more details.

We are truly proud of our work extending the Navigator Proxy Auto-Config (PAC) File Format specification to work with IPv6 addresses while ensuring backwards compatibility, as we believe these changes will prove useful current and future IPv6 users. These changes are available for WinINet/WinHTTP in Windows Vista starting in Beta 2, for WinINet on XP and Windows 2003 through IE7 starting in Beta 2 and will be available in a future release of the .Net Framework’s system.net. We would love to hear feedback from the community regarding these changes and if you are planning to deploy a WPAD script in an IPv6 network please let us know about your experience.

Thanks

-Jonathan Silvera