My favorites | Sign in
Logo
Project hosting will be READ-ONLY Wednesday at 8am PST due to brief network maintenance.
             
New issue | Search
for
| Advanced search | Search tips
Issue 25407: Support Internet Explorers PAC extensions
4 people starred this issue and may be notified of changes. Back to list
Status:  Assigned
Owner:  eroman@chromium.org
Type-Bug
Pri-2
OS-All
Mstone-X
IPv6
Fixit
Area-Internals


Sign in to add a comment
 
Reported by eroman@chromium.org, Oct 21, 2009
Internet explorer supports some extensions to PAC to play nice with IPv6:

    isResolvableEx()
    isInNetEx()

    dnsResolveEx()
    myIpAddressEx()
    sortIpAddressList()

http://blogs.msdn.com/wndp/articles/IPV6_PAC_Extensions_v0_9.aspx
http://blogs.msdn.com/wndp/archive/2006/07/18/IPV6-WPAD-for-WinHttp-and-WinInet.aspx


Comment 1 by jon@chromium.org, Oct 21, 2009
(No comment was entered for this change.)
Status: Assigned
Labels: -Area-Misc Area-BrowserBackend Mstone-X IPv6 Fixit
Comment 2 by eroman@chromium.org, Oct 21, 2009
Context: this is related to  bug  24641  -- basically once we bodge the existing PAC functions to match IE rather 
than Firefox (such that they no longer support IPv6), we should follow up by adding the IPv6 capable extensions.
Comment 3 by bugdroid1@chromium.org, Oct 26, 2009
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=30127 

------------------------------------------------------------------------
r30127 | eroman@chromium.org | 2009-10-26 16:51:28 -0700 (Mon, 26 Oct 2009) | 25 lines
Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/net/base/load_log_event_type_list.h?r1=30127&r2=30126
   M http://src.chromium.org/viewvc/chrome/trunk/src/net/data/proxy_resolver_v8_unittest/bindings.js?r1=30127&r2=30126
   A http://src.chromium.org/viewvc/chrome/trunk/src/net/data/proxy_resolver_v8_unittest/dns_fail.js
   M http://src.chromium.org/viewvc/chrome/trunk/src/net/proxy/proxy_resolver_js_bindings.cc?r1=30127&r2=30126
   M http://src.chromium.org/viewvc/chrome/trunk/src/net/proxy/proxy_resolver_js_bindings.h?r1=30127&r2=30126
   M http://src.chromium.org/viewvc/chrome/trunk/src/net/proxy/proxy_resolver_js_bindings_unittest.cc?r1=30127&r2=30126
   M http://src.chromium.org/viewvc/chrome/trunk/src/net/proxy/proxy_resolver_script.h?r1=30127&r2=30126
   M http://src.chromium.org/viewvc/chrome/trunk/src/net/proxy/proxy_resolver_v8.cc?r1=30127&r2=30126
   M http://src.chromium.org/viewvc/chrome/trunk/src/net/proxy/proxy_resolver_v8_unittest.cc?r1=30127&r2=30126

Add three of the six extensions to PAC that Internet Explorer supports. 

The following descriptions were taken from <http://blogs.msdn.com/wndp/articles/IPV6_PAC_Extensions_v0_9.aspx> 

---------------------------- 
* myIpAddressEx(): 
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. 

* dnsResolveEx(host): 
Returns semi-colon delimited string containing IPv6 and IPv4 addresses or an empty string if host is not resolvable. 

* isResolvableEx(): 
Returns TRUE if the host is resolvable to a IPv4 or IPv6 address, FALSE otherwise. 
---------------------------- 

These differ from the vanilla PAC functions in the following ways: 

* myIpAddressEx() returns all the addrsses for localhost (including IPv6 ones), whereas myIpAddress() only returns the first IPv4 one. 
* On failure, myIpAddress() returns "127.0.0.1" whereas on failure myIpAddressEx() returns empty string. 
* dnsResolveEx() returns a list of addresses (including IPV6 ones), whereas dnsResolve() only returns the first IPv4 address. 
* On failure, dnsResolve() returns |null|, whereas on failure dnsResolveEx() returns empty string. 

BUG=25407
TEST=ProxyResolverV8Test.DNSResolutionFailure, ProxyResolverJSBindingsTest.RestrictAddressFamily, ProxyResolverJSBindingsTest.ExFunctionsReturnList
Review URL: http://codereview.chromium.org/333006
------------------------------------------------------------------------

Comment 4 by eroman@chromium.org, Oct 26, 2009
Ok, I added myIpAddressEx(), dnsResolveEx() and isResolvableEx().

I implemented them as described by <http://blogs.msdn.com/wndp/articles/IPV6_PAC_Extensions_v0_9.aspx>.

Unfortunately, that spec doesn't precisely line up with what Internet Explorer does (in respect to square brackets 
in IPv6 literals). I am following up on that post to ask how those cases are supposed to work.
Comment 5 by martin.dragt, Dec 15, 2009
I'm using google-chrome 4.0.249.30 on a fedora 12 linux box. The issue is that the 
machine has more than one valid IPv4 address, as many linux boxes do. The 
myIpAddress() function returns 'the first' IPv4 address it can find - whichever one 
that is. The function thus incidently returns the IPv4-address of the loopback 
adapter 127.0.0.1 which is bogus of course.

As most problems are caused on laptops travelling between home and office, I thought 
of a workaround: use dnsResolve() to investigate if the proxy-server is accessible 
(return "DIRECT" if not) before any other checks. 

The real problem is to have myIpAddress() to return the IP-address actually being 
used by the browser, not one from a random(?) list.

Comment 6 by eroman@chromium.org, Dec 16, 2009
@martin.dragt: We should have this discussion on a separate issue, since it isn't really 
related to the IE PAC extensions.

I am tempted to say that behavior is "working as intended", since AFAIK that is what 
Firefox and other browsers will do too. myIpAddress() does not try to get the IP of the 
default interface, but rather is equivalent to a dnsResolve(<my computer's host name>). 
(However I think it would be reasonable to skip over 127.0.0.1 if there are other 
addresses.)

One workaround you can do is use the myIPAddressEx() extension to get all of the 
addresses, and then filter out the ones you don't care for (such as ::1, 127.0.0.1):

  var my_addresses = myIpAddressEx().split(";");

  for (var i = 0; i < my_addresses.length; ++i) {
    if (my_addresses[i] == XXXXXXX) {
       ...
    }
  }

Alternately, for your use-case, it sounds like you could just do:

    return "PROXY foobar:80; DIRECT";

Now if the browser can't connect to foobar:80, it will fallback to DIRECT (this is faster than 
testing resolvability from the PAC script, since we cache the failure rather than re-testing 
on each request).
Comment 7 by or...@chromium.org, Dec 17, 2009
Labels Update:

Replace Area-BrowserBackend by Area-Internals
Labels: -Area-BrowserBackend Area-Internals
Sign in to add a comment