PC Review


Reply
Thread Tools Rate Thread

How do I get WebProxy to work in HttpWebRequest?

 
 
=?Utf-8?B?TXJOb2JvZHk=?=
Guest
Posts: n/a
 
      21st Nov 2007
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.
 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      21st Nov 2007
MrNobody,

Are you actually setting the Proxy property of the HttpWebRequest to
that instance of the WebProxy?


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"MrNobody" <(E-Mail Removed)> wrote in message
news:2089C1EB-2817-45A4-A165-(E-Mail Removed)...
>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.



 
Reply With Quote
 
=?Utf-8?B?TXJOb2JvZHk=?=
Guest
Posts: n/a
 
      21st Nov 2007
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]
> - (E-Mail Removed)
>
> "MrNobody" <(E-Mail Removed)> wrote in message
> news:2089C1EB-2817-45A4-A165-(E-Mail Removed)...
> >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.

>
>
>

 
Reply With Quote
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      21st Nov 2007
And what kind of errors are you getting? Can you create a complete
example program?


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"MrNobody" <(E-Mail Removed)> wrote in message
news7877277-6732-423A-ACB8-(E-Mail Removed)...
> 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]
>> - (E-Mail Removed)
>>
>> "MrNobody" <(E-Mail Removed)> wrote in message
>> news:2089C1EB-2817-45A4-A165-(E-Mail Removed)...
>> >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.

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Learning to work with streams and HttpWebRequest David Microsoft VB .NET 0 11th Aug 2007 06:07 AM
PRB - HttpWebRequest does not work with CGI websites and/or RAW da =?Utf-8?B?QVRT?= Microsoft C# .NET 1 20th Oct 2005 10:24 PM
HttpWebRequest doesn't work with JavaScript ;-( milkyway Microsoft ASP .NET 5 5th Oct 2005 05:25 AM
HttpWebRequest.GetResponse does not work on some uris Anton Sommer Microsoft Dot NET Framework 6 27th Dec 2004 06:55 AM
work with HttpWebRequest locally John A Grandy Microsoft ASP .NET 1 26th Aug 2004 07:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:52 PM.