You are not logged in.

Dear visitor, welcome to If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.


Monday, November 9th 2009, 7:35pm

Writing HTTP proxy server with SSL support

Hello guys.
I know how to write HTTP proxy server.
The idea - 2 sockets. One http request with connection close: browser connects to browser_socket, then we read request header from it, connect server_socket to specified server, send browser header to the server, read response header, and then create loop - read from server socket and write to browser socket HTTP body .

Also I can write HTTP SSL client.

Does any body knows how to use SSL socket in that way? Actually SSL works in another scenario. Browser sends header with CONNECT field before it send get/post. Also it called tunneling via HTTP. I need a scenario how browser and proxy communicate.

Also I read, that in that way (using SSL) proxy does not know about data, data is encrypted for proxy. But browser connects to proxy using tcp socket without ssl. :S I think...

Please: advice/links/code examples. I will be glad for anything help.