I was investigating the slowness of proxy initialization (PrivateInvoke method) and found that many people have recommended that we set the usedefaultwebproxy to false. But before going ahead with the fix I'd like to know more about what it is and what it does? How can it impact other areas of my code etc.
3 Answers
BasicHttpBinding.UseDefaultWebProxy says if the service should use the default web proxy or not. If it is false, then you can set the proxy by using the BasicHttpBinding.ProxyAddress. If true, then the "default proxy" is used, so if your Application pool identity is set as a domain user, then the default proxy setting is read from that user's profile. If the identity is a system user, I'm not sure how you set the default proxy. Not using the default proxy would be a good idea if you don't want to depend on the default proxy being correctly set. You will probably also save some time in reading the default proxy settings, expecially if the application pool identity has a big or corrupted profile.

- 4,914
- 2
- 23
- 27
The "what" is on MSDN - it just controls whether it should find the proxy from system configuration, or whether you will specify it. If we assume that you're going to give it the same value anyway, then the only use would seem to be: to avoid an extra lookup (which could take an unknown time, maybe?). However, it might be that you want to bypass the proxy completely and go direct. I certainly remember (back in the day) using proxycfg and netsh to disable the proxy for local addresses, but that was (IIRC) more to do with passing windows credentials to a local server.

- 1,026,079
- 266
- 2,566
- 2,900