Hi, I am writing an HTTP proxy for a web browser, using Winsock and C++. For now the proxy should behave as if there was no proxy, just redirecting the requests towards the correct server, and the html data towards the browser. Also, it is synchronous.
It works, but performance is quite bad currently. Before I try anything else, I am wondering if at least the basic logic is correct. Here's some pseudocode:
I am mainly wondering if it is correct to close both browser and server sockets and create new ones everytime. For loading a simple page like Google, it will go 3 times through that loop; more involved pages will go numerous times through it.
Question
Andre S. Veteran
Hi, I am writing an HTTP proxy for a web browser, using Winsock and C++. For now the proxy should behave as if there was no proxy, just redirecting the requests towards the correct server, and the html data towards the browser. Also, it is synchronous.
It works, but performance is quite bad currently. Before I try anything else, I am wondering if at least the basic logic is correct. Here's some pseudocode:
I am mainly wondering if it is correct to close both browser and server sockets and create new ones everytime. For loading a simple page like Google, it will go 3 times through that loop; more involved pages will go numerous times through it.
Thanks!
Link to comment
https://www.neowin.net/forum/topic/889590-basic-winsock-proxy/Share on other sites
5 answers to this question
Recommended Posts