views:

109

answers:

1

Hi, I'm doing some networking programming for Windows right now envolving the HTTP protocol.

Is it possible to handle prosies at socket level? And SSL proxies? If not, does Windows provide something at a higher level to handle them? I wouldn't like to use a third party library, but if there's no other way to go I would reconsider it.

A pointer to an example would also be great.

Thank you very much.

A: 

You can use for example Windows Internet (WinINet) API http://msdn.microsoft.com/en-us/library/aa383630%28v=VS.85%29.aspx or Windows HTTP Services (WinHTTP) http://msdn.microsoft.com/en-us/library/aa384273%28v=VS.85%29.aspx if are interesting for HTTP protocol only. Advantage of using this API is:

  • They are Microsoft standard and will be used in a lot of Microsoft products
  • They are part of operation system and exists on any Windows
  • You can find a lot of examples for almost every subject

What kind of working with proxies do you plan?

Oleg
Thanks for the info, I'll look into it as I will only need HTTP (maybe HTTPs in future). I'm planning to allow the program to connect and operate using the system-wide proxy configuration and local (located in the app configuration: user, password, server and port). Right now I have written the logic using plain sockets (i.e. send / recv) but I don't know if I can handle proxy servers in this low level.
Marta
If I understand you correct you have implemented a simple communication protocol with a Web server and you want to modify the code to be very flexible if client connects to you web server with a proxy server in the middle. In the case you will be able easy replace socket API to WinINet or WinHTTP API. See code example for WinHTTP on http://msdn.microsoft.com/en-us/library/aa383144%28v=VS.85%29.aspx and WinINet http://msdn.microsoft.com/en-us/library/aa383996%28v=VS.85%29.aspx. The only restriction is that WinINet should be not used in a service (only in GUI app.) because of possible dialogs.
Oleg
Yes, you understood me perfectly. Thank you very much, I'll use any of this APIs instead :).
Marta