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 connected
* Connected to wpad.nuim.ie ( 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, '', '')) {
        return 'DIRECT';
    if (isInNet(host, '', '')) {
        return 'DIRECT';
    if (isInNet(host, '', '')) {
        return 'DIRECT';
    if (isInNet(host, '', '')) {
        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
  • 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
  • possible duplicate of Proxifier that supports UDP? – Paul Sweatte Jun 1 '15 at 15:20
  • @PaulSweatte I don't think this is a duplicate of that one. Windows update doesn't seem to use UDP. – BeowulfNode42 Oct 1 '18 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.