Connection to website using Proxy [Archive] - C Board

PDA

View Full Version : Connection to website using Proxy


password
04-23-2008, 04:26 AM
I want to make a console application which connects to a certain website trough a specified HTTP-proxy. Is this preferable to do in C++ and what do I need in order to get started?

39ster
04-24-2008, 03:22 AM
I would use C++ over C. To use a proxy all you do is send the same data you would if you were directly connected to the http server, except you send it to the proxy and in the GET request you put both the file name and host name. Do for example if you send a get request directly to google you would send:

"GET /index.php\r\n"

But using a proxy, send it to the proxy and make it:

"GET www.google.com/index.php\r\n"

plus all the other usual header info.