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
 }
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
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:



(not displayed)


 
 
 
 
 

Live Comment Preview:

 
«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910