Connecting Tech Pros Worldwide Forums | Help | Site Map

Connecting to webserver over proxy

Member
 
Join Date: Apr 2007
Posts: 75
#1: Jul 3 '08
Hi Guys,
I am writing a new application which will download files from http web server [c# .Net 2.0] using MTOM & WSE 3. I have written a test client for this [in c# .Net 2.0] which works fine on normal networks. I run into problem when the network where client is running is Proxy.

Can someone please advise how can I connect using proxy to the web service for clients using proxy? If possible some tutorial or a sample project would be highly appreciated as I have never worked with proxy networks before!


Thanks in advance!

Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#2: Jul 3 '08

re: Connecting to webserver over proxy


I *think* you can attempt to look in the registry (Where? don't know) to find the proxy information stored with IE. (What to do if they don't use IE, I also don't know) And could try using that?

I think that the HttpWebRequest object has support for putting proxy information in. There might be some msdn help in that area.

Basic HTTP request
Expand|Select|Wrap|Line Numbers
  1. GET / HTTP/1.0
  2.  
  3.  
Basic HTTP request through a proxy
Expand|Select|Wrap|Line Numbers
  1. GET http://bytes.com/ HTTP/1.0
  2.  
  3.  

Note, that when going through a proxy, the request URI in the GET line has the full web address (the proxy can then chose to send off the regular HTTP request to the correct location that way)
Member
 
Join Date: Apr 2007
Posts: 75
#3: Jul 4 '08

re: Connecting to webserver over proxy


Quote:

Originally Posted by Plater

I *think* you can attempt to look in the registry (Where? don't know) to find the proxy information stored with IE. (What to do if they don't use IE, I also don't know) And could try using that?

I think that the HttpWebRequest object has support for putting proxy information in. There might be some msdn help in that area.

Basic HTTP request

Expand|Select|Wrap|Line Numbers
  1. GET / HTTP/1.0
  2.  
  3.  
Basic HTTP request through a proxy
Expand|Select|Wrap|Line Numbers
  1. GET http://bytes.com/ HTTP/1.0
  2.  
  3.  

Note, that when going through a proxy, the request URI in the GET line has the full web address (the proxy can then chose to send off the regular HTTP request to the correct location that way)

Thanks Plater. I am not too fussed about retrieving these settings from IE registry as most users will be more than happy to re-enter this information. Can someone guide me to a sample for HTTP MTOM request over proxy?

Thanks,
Reply


Similar .NET Framework bytes