.NET development, Information Worker, Sharepoint and Team System June 2008 - Posts - Jean-Pierre under the Guru Meditation Tree

June 2008 - Posts

WPAD.dat and Visual Sudio 2008 Web Tests - problem
Tuesday, June 03, 2008 9:23 AM

We are using Visual Studio 2008 Team Edition for Software Testers to run web tests against our test website.

We find that our tests are failing on a particular request for a wpad.dat file.  No http error is reported. 

 

After some searching on the internet, we discovered just what a wpad.dat file is:

 WPAD (Web Proxy Autodiscovery Protocol)

·         Check  out a full description of what it is on http://en.wikipedia.org/wiki/Web_Proxy_Autodiscovery_Protocol

·         This is simply a method used by browsers to auto-discover the location of a proxy auto-config (.pac) file. 

·         You can set this up in your network through one of two methods:

o   DHCP

o   DNS

·         If your network is not configured for WPAD, you may have problems if your browsers are configured to “autodetect”.

 Solution to our problem

·         Internet Explorer:

o   / Internet Options / Connections / LAN Settings

o   Turn OFF the option to automatically detect proxy settings.

·         Contact network admin to see whether wpad is correctly configured.

 

The problem occurs for us ONLY when using the web test interface.  Through the browser, everything is OK.  We have decided to configure IE and consider the test to have passed. 

 Requirements to get WPAD to work properly (from WIKIPEDIA)

In order for WPAD to work, a few requirements have to be met:

 

·         If you want to use DHCP, then the DHCP must be configured to serve up the "site-local" option 252 ("auto-proxy-config") with a string value of "http://xxx.yyy.zzz.qqq/wpad.dat" (without the quotes) where xxx.yyy.zzz.qqq is the address of a web server (either IP or DNS).

·         If you want to use DNS, then a DNS entry is needed for a host named WPAD.

·         The host WPAD must be able to serve a web page.

·         In both cases, the web server must be configured to set up dat files with a MIME type of "application/x-ns-proxy-autoconfig".

·         The file named wpad.dat must be located in the WPAD web site's root directory.

·         Examples for PAC files are shown in Proxy auto-config.

·         Use caution when configuring a WPAD server in a virtual hosting environment. When automatic proxy detection is used, Internet Explorer sends a "Host: <IP address>" header and Firefox sends a "Host: wpad" header. This is unexpected behavior, therefore, it is recommended that the wpad.dat file be hosted under the default Virtual Host rather than its own. 

Note the last point, which indicates potential problems when using virtual hosting.  What is “virtual hosting”?  It is the procedure of serving up the same website from multiple host header names or IP addresses – this has been employed in our project.  This indicates a potential source for our problem, which you might want to investigate if you experience the same problem.

 

Happy web testing!

 

Kind Regards

Jean-Pierre Fouche