Extensions to the Navigator Proxy Auto-Config File Format specification to support IPv6 v0.9

The following functions are extensions to the Navigator Proxy Auto-Config File Format specification to enable WPAD scripts to handle IPv6 capable networks:

Predefined Functions and Environment for the JavaScript Function FindProxyforURLEx:

 


 

isResolvableEx(host)

 

This API determines if a given host string can resolve to an IP address

host – string containing the HTTP host that is supplied to FindProxyForUrl

returns TRUE if the host is resolvable to a IPv4 or IPv6 address, FALSE otherwise.

Examples:

isResolvableEx(host);

         is true if the hostname can be resolved to and IP address

isResolvableEx(host);

         is false if the hostname cannot be resolved to an IP address

 


 

isInNetEx(IPaddress, IPprefix)

 

Determines if an IP address is in a specific subnet.

IPaddress – string containing IPv6/IPv4 addresses

IPprefix – string containing colon delimited IP prefix with top n bits specified in the bit field (i.e. 3ffe:8311:ffff::/48 or 123.112.0.0/16).

Returns TRUE if the host is in the same subnet and FALSE otherwise.

Also returns FALSE if prefix is not in the correct format or if addresses and prefixes of different types are used in the comparison (i.e. IPv4 prefix and an IPv6 address).

Examples:

isInNetEx(host, "198.95.249.79/32")

is true iff the IP address of host matches exactly 198.95.249.79.

isInNetEx(host, "198.95.0.0/16")

is true iff the IP address of the host matches 198.95.*.*.

isInNetEx(host, "3ffe:8311:ffff/48")

is true iff the IP address of the host matches 3ffe:8311:fff:*:*:*:*:*

 


dnsResolveEx(host)

 

Resolve a host string to its IP address

host – string containing the HTTP host that is supplied to FindProxyForUrl

returns semi-colon delimited string containing IPv6 and IPv4 addresses or an empty string if host is not resolvable.

FindProxyforURLEx implementers should add code that breaks the string of semi-colon delimited IP addresses into separate addresses.

Examples:

dnsResolveEx("testmachine1")

returns the string "fe80::380c:2e71:f5b9:a3b5%15;fe80::982d:a3b3:97ad:7dd0%9;2001:4898:28:7:982d:a3b3:97ad:7dd0;2001:4898:28:7:adfe:a643:8130:2fdc;fe80::5efe:10.70.92.74%13;3ffe:8311:ffff:f70f:0:5efe:10.70.92.74;10.70.92.74;3ffe:831f:4136:e37e:380c:2e71:f5b9:a3b5".

 


myIPAddressEx()

 

Finds all the IP addresses for localhost

Returns a semi-colon delimited string containing all IP addresses for localhost (IPv6 and/or IPv4), or an empty string if unable to resolve localhost to an IP address.

FindProxyforURLEx implementers should add code that breaks the string of semi-colon delimited IP addresses into separate addresses.

Examples:

  • myIpAddressEx()

    would return the string "fe80::380c:2e71:f5b9:a3b5%15;fe80::982d:a3b3:97ad:7dd0%9;2001:4898:28:7:982d:a3b3:97ad:7dd0;2001:4898:28:7:adfe:a643:8130:2fdc;fe80::5efe:10.70.92.74%13;3ffe:8311:ffff:f70f:0:5efe:10.70.92.74;10.70.92.74;3ffe:831f:4136:e37e:380c:2e71:f5b9:a3b5" if you were running on that host.


sortIpAddressList(IpAddressList)

 

This API sorts a list of IP addresses

IpAddressList - semi-colon delimited string containing IP addresses.

Returns a list of sorted semi-colon delimited IP addresses or an empty string if unable to sort the IP Address list.

FindProxyforURLEx implementers should add code that breaks the string of semi-colon delimited IP addresses into separate addresses.

Examples:

sortIpAddressList(2001:4898:28:3:201:2ff:feea:fc14;

                  157.59.139.22;

                  fe80::5efe:157.59.139.22")

returns

"fe80::5efe:157.59.139.22;2001:4898:28:3:201:2ff:feea:fc14;157.59.139.22"

A list of sorted IP addresses. If there both IPv6 and IPv4 IP addresses are passed as input to this function, then the sorted IPv6 addresses are followed by sorted IPv4 addresses


getClientVersion()

 

Used to get the version of the WPAD processing engine.

Currently this function returns version 1.0. We added this function to allow IT administrators to update their WPAD scripts to use different versions of the WPAD processing engine without causing breaks to their existent deployment. An example of this would be: If we added function foo() to the 2.0 version of the WPAD engine, then administrators can check the version before attempting to call the function. This allows their script to work with client running versions 1.0 and 2.0 of the WPAD engine.

Examples:

getClientVersion()

returns the appropriate versions number of the WPAD engine.

June 2006

Comments

  • Anonymous
    July 19, 2006
    Hi, my name is Jonathan Silvera and I am the WinINet and WinHTTP Program Manager. Today I would like...

  • Anonymous
    May 14, 2008
    Why does "myIpAddress()" only return a v6 address when used through other browsers (such as Firefox); and the additional functions like myIpAddressEx() are not available? Surely myIpAddress should continue to ONLY return v4 addresses (as per its stated original definition) and new functions should be introduced to handle v4 and v6 to maintain backward compatibility? That's why we did these extensions and shared out our spec. So far it appears from your comment that Firefox hasn't implement it and further more break existing scripts by returning an ipv6 address in myIpAddress(). -- Ari

  • Anonymous
    May 19, 2008
    How can I use these APIs in c++ (specially dnsResloveEx()). Or is there any equilvalent API in c++? These APIs are specific to the scripting host for WPAD scripts. For general purpose development with unmanaged code (not c#/VB.net/etc) you want getaddrinfo. You might want to check out our general guide to IPV6 enabling of Winsock applications. -- Ari

  • Anonymous
    June 26, 2008
    Could you very kindly tell me, how I can implement these *Ex functions, when I try to fill an AutoProxyHelperVtbl? The examples I could find are unfortunately IPv4 only: http://msdn.microsoft.com/en-us/library/aa383910(VS.85).aspx. (I would like to point out that, quite confusingly to me, they do not seem to match the (rather laconic) specification I found at http://msdn.microsoft.com/en-us/library/aa383907(VS.85).aspx, regarding the return values.) I'll forward your request for more sample code to the team. I'd also suggest filing a suggestion/issue on out connect site http://connect.microsoft.com/wndp -- Ari

  • Anonymous
    July 10, 2008
    Hi, I would like to note that case seems to matter (at least for WinINet). So, the case sensitive names of these functions appear to be: FindProxyForURLEx sortIpAddressList Thanks, Vadasz Fixed, Thanks. -- Ari

  • Anonymous
    January 01, 2009
    Hi Ari, Thanks for looking at proxy autoconfig. It would be nice to have access to something like navigator.userAgent to determine what engine we are using It would be nice to have a function that gets the routing information to a host: local interface IP local Interface Name getway IP Destination Network/Mask Protocol (IPv4/IPv6) This would be extremly usefull to determine traffic to be routed via a pptp, l2tp or dialup-connection and not via a internetproxy in a branch / home office. Why doesn't  myIPAddressEx return a Array ?  same for dnsResolveEx ? We could do things like var myIps = myIPAddressEx(); myIps.sort(); myIps.reverse(); myIps.foreach(MyNiftFunction) Thanks Manon <manon at manon dot de> hmm.. If you are suppling a pac file, you probably already have some knowledge of the local network's IP addressing scheme, and hence can work out the information you want from from the local ip addreeses. As for the the array request, we kept it consistant with the orginal netscape spec, however you should get want you want with a quick call to split. -- Ari

  • Anonymous
    October 26, 2009
    Hi, I am implementing this for another browser, and would like a couple clarifications on the specification: (1) How are IPv6 addresses that appear in lists supposed to be formatted? (with respect to surrounding square brackets). From the examples, I expect square brackets should NOT be included. But when running some examples in Internet Explorer I find that they are included. This means the difference between:  "74.125.71.163;::1"     <-- what I expect from spec and  "74.125.71.163;[::1]"   <--- actual It seems most consistent to NOT include the square brackets anywhere, rather than have some functions expect/return square brackets, but others not. (2) I think the third example under isInNetEx() has a typo -- this is an incomplete IPv6 address, and should end with "::" to indicate that the rest are zeros. (3) What is the expected behavior of isInNetEx() when digits outside of the mask are non-zero? Under Internet Explorer:    isInNetEx("198.95.1.1, "198.95.0.0/16") --> true However:    isInNetEx("198.95.1.1, "198.95.3.3/16") --> false Seems the second isInNetEx() should still be true, and it shouldn't matter that the lower two bytes were threes. Thanks.