470,641 Members | 1,535 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,641 developers. It's quick & easy.

How do I get WebProxy to work in HttpWebRequest?

I found an example online and when I tried repeating it with the proxy I
normally use for my browser, I get errors.

What I do is this:

WebProxy proxy = new WebProxy("http://www.autoconfig/pac", true);

That url is exactly what I enter into Firefox advanced settings to get
beyond the office firewall here, but C# does not like it.

any idea?

the proxy is free, no login credentials required so I did not set that
object in code. You can try it yourself now, the proxy wont interfere with
the fact you are not behind a firewall.
Nov 21 '07 #1
3 4033
MrNobody,

Are you actually setting the Proxy property of the HttpWebRequest to
that instance of the WebProxy?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"MrNobody" <Mr******@discussions.microsoft.comwrote in message
news:20**********************************@microsof t.com...
>I found an example online and when I tried repeating it with the proxy I
normally use for my browser, I get errors.

What I do is this:

WebProxy proxy = new WebProxy("http://www.autoconfig/pac", true);

That url is exactly what I enter into Firefox advanced settings to get
beyond the office firewall here, but C# does not like it.

any idea?

the proxy is free, no login credentials required so I did not set that
object in code. You can try it yourself now, the proxy wont interfere with
the fact you are not behind a firewall.

Nov 21 '07 #2
Yes indeed,

req.Proxy = proxy;

"Nicholas Paldino [.NET/C# MVP]" wrote:
MrNobody,

Are you actually setting the Proxy property of the HttpWebRequest to
that instance of the WebProxy?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"MrNobody" <Mr******@discussions.microsoft.comwrote in message
news:20**********************************@microsof t.com...
I found an example online and when I tried repeating it with the proxy I
normally use for my browser, I get errors.

What I do is this:

WebProxy proxy = new WebProxy("http://www.autoconfig/pac", true);

That url is exactly what I enter into Firefox advanced settings to get
beyond the office firewall here, but C# does not like it.

any idea?

the proxy is free, no login credentials required so I did not set that
object in code. You can try it yourself now, the proxy wont interfere with
the fact you are not behind a firewall.


Nov 21 '07 #3
And what kind of errors are you getting? Can you create a complete
example program?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"MrNobody" <Mr******@discussions.microsoft.comwrote in message
news:D7**********************************@microsof t.com...
Yes indeed,

req.Proxy = proxy;

"Nicholas Paldino [.NET/C# MVP]" wrote:
>MrNobody,

Are you actually setting the Proxy property of the HttpWebRequest to
that instance of the WebProxy?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"MrNobody" <Mr******@discussions.microsoft.comwrote in message
news:20**********************************@microso ft.com...
>I found an example online and when I tried repeating it with the proxy I
normally use for my browser, I get errors.

What I do is this:

WebProxy proxy = new WebProxy("http://www.autoconfig/pac", true);

That url is exactly what I enter into Firefox advanced settings to get
beyond the office firewall here, but C# does not like it.

any idea?

the proxy is free, no login credentials required so I did not set that
object in code. You can try it yourself now, the proxy wont interfere
with
the fact you are not behind a firewall.



Nov 21 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jim Douglas | last post: by
4 posts views Thread by vooose | last post: by
2 posts views Thread by Sam Santiago | last post: by
reply views Thread by Michael S. Scherotter | last post: by
4 posts views Thread by Andrew | last post: by
reply views Thread by JTowns | last post: by
7 posts views Thread by Phil | last post: by
1 post views Thread by Korara | last post: by
???
1 post views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.