Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to get proxy auto detection working on a network, and it is working fine for all browsers, including IE, but Windows Update will not work.

I have set up a web server to serve the same WPAD file from: http://wpad.ourdomain.com/wpad.dat http://proxy.ourdomain.com/proxy.pac http://proxy.ourdomain.com/

I've set the MIME type to be returned as application/x-ns-proxy-autoconfig, and I've added option 252 to our DHCP server to the PAC URL.

Initially I had Unix line-endings on the file, so I thought that might be making Windows cranky, so I changed it to Windows line endings with no change.

When I specify the same proxy details the PAC does manually Windows Update is happy, but when told to auto-detect, or to explicitly use our PAC URL, Windows Update fails.

The way Windows Update fails is also very strange, you can go to the page, and it loads just fine, probably because IE has no problems with the PAC file, but, as soon as you click on the button for "Express" (or "Custom" for that matter), then the progress bar spins for 5 minutes or so, and then returns an error saying it failed to connect.

This is the full content being return from WPAD including the HTTP headers (though anonymised):

$ curl http://wpad.ourdomain.com/wpad.dat -v
* About to connect() to wpad.ourdomain.com port 80 (#0)
*   Trying 10.0.0.80... connected
* Connected to wpad.nuim.ie (10.0.0.80) port 80 (#0)
> GET /wpad.dat HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: wpad.ourdomain.com
> Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Thu, 22 Mar 2012 14:14:38 GMT
< Server: Apache/2.2.15 (Red Hat)
< Expires: Thu, 22 Mar 2012 17:14:38 GMT
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: application/x-ns-proxy-autoconfig; charset=ISO-8859-1
< 
function FindProxyForURL(url, host) {
    if (isInNet(host, '1.2.0.0', '255.255.0.0')) {
        return 'DIRECT';
    }
    if (isInNet(host, '10.0.0.0', '255.0.0.0')) {
        return 'DIRECT';
    }
    if (isInNet(host, '127.0.0.1', '255.255.255.255')) {
        return 'DIRECT';
    }
    if (isInNet(host, '192.168.0.0', '255.255.0.0')) {
        return 'DIRECT';
    }

    if (localHostOrDomainIs(host, 'somehost.something.com')) {
        return 'DIRECT';
    }
    if (localHostOrDomainIs(host, 'someotherhost.somethingelse.com')) {
        return 'DIRECT';
    }

    return "PROXY proxy1.ourdomain.com:3128;PROXY proxy2.ourdomain.com:3128;DIRECT";
}

//some debug information here in a comment
* Closing connection #0
share|improve this question
    
Update - Skype also has problems with our PAC/WPAD file, but IE, chrome, FireFox & Safari are all working fine with it. –  Bart B Mar 22 '12 at 15:22
    
Is something in the logs of the proxies? Skype and Windows Update will use CONNECT: for SSL. Did you try SSL encrypted sites? –  Turbo J Mar 22 '12 at 23:56
    
HTTPS is working fine in IE. Also, when watching the web server and proxy logs you can see Windows ask for an get the PAC file (return code 200 OK), then it never even tries to connect to the proxy server, so it seems that it is not parsing the PAC file for some reason. By contrast you can watch IE using the PAC file and see it get the PAC File form the web server, and then instantly you see the traffic in the proxy logs. –  Bart B Mar 23 '12 at 12:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.