I'm new to C/C++ but have worked with PHP for years and want to make a program to tie in with my web applications.

I want to write a program that listens on port 80 for incoming HTTP/HTTPS traffic to a web browser. Then checks HTTP headers from a list, if header(s) are present then save it to a text file and remove header before sending to back to the browser.


HTTP/1.1 200 OK
Content-type: text/html
X-Gateway-Id: value

(content of page)

So the server sends the above HTTP response and the program removes "X-Gateway-Id: value" and stores in text file and sends the following to the web browser:

HTTP/1.1 200 OK
Content-type: text/html

(content of page)

Please if you could show me links that would help or some examples that would be great.


There are plenty of example source code in the web.

Refer this guide for a start.

Thanks for the quick reply.

This is the job to learn the basics but after reading this can you tell me what i should be searching for, at the moment I using "C++ modify http traffic/responses" etc.

Thanks again.

Assuming you're using Windows, you should search for "winapi recv hooking" and "winapi detours".

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.