In .Net 2.0 the following used to work:
HttpWebRequest httpWReq = (HttpWebRequest)WebRequest.Create("http://www.google.com");
WebProxy proxy = (WebProxy) WebRequest.DefaultWebProxy;
I'm using .Net 4.5 and now it is returning IWebProxy
instead of WebProxy
.
How can I cast it to be WebProxy
instead of IWebProxy
?
The reason that I want to do this is to check proxy.Address.AbsoluteUri
and it isn't accessible using IWebProxy
.