If DefaultProxy address is not specified in config file, GetProxy returns unchanged URL

I found in debugger that when I am using static WebRequest.DefaultWebProxy and there is no proxy address specified in the config file,

IWebProxy.GetProxy returns the same address, as it was passed.

IWebProxy iDefaultWebProxy = WebRequest.DefaultWebProxy;

Uri uriProxy = iDefaultWebProxy.GetProxy(

I haven't seen this in documentation, but the thread confirms the behavior.

new Uri(ws.Url));
if (sProxyUrl == ws.Url)
{
//no proxy specified
 }

posted @ Wednesday, March 07, 2007 3:42 PM

Print

Comments on this entry:

# rExplicitely specify Default user credentials for Proxy Server.

Left by Michael Freidgeim at 3/9/2007 12:44 PM
Gravatar
I've created common function to set web proxy credentials SetDefaultWebProxyCredentialsIfRequired(aws);
See http://geekswithblogs.net/mnf/archive/2007/03/09/108325.aspx

# re: If DefaultProxy address is not specified in config file, GetProxy returns unchanged URL

Left by web development company at 8/28/2009 6:45 AM
Gravatar
Hey, that was interesting,

um so simple coe and I like how it works properly

Thanks for writing, most people don't bother.

Your comment:



 (will not be displayed)


 
 
 
 
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345