IWebProxyScript is used internally by WebProxy itself.
If you initialize WebProxy with the URL of the WPAD script, it will resolve the correct URL for requests sent to it. You can set this WebProxy to WebRequest, and it will automatically handle setting the correct proxy URL for the request target.
WebRequest request = WebRequest.Create("http://targeturl"); request.Proxy = new WebProxy("http://url.to/wpad.dat");
You can also get the proxy server url for a given purpose, for example:
WebProxy proxy = new WebProxy("http://url.to/wpad.dat"); Uri proxyUri = proxy.GetProxy(new Uri("http://targeturl"));
This does NOT work for PAC scripts.
source share