I am beginning work on a very basic HTTP proxy server written in C (Edit: something that just forwards my requests). At this point I am having difficulty in understanding how to proceed.
Any help would be beneficial.
I am beginning work on a very basic HTTP proxy server written in C (Edit: something that just forwards my requests). At this point I am having difficulty in understanding how to proceed.
Any help would be beneficial.
Take a look at micro_proxy
. It implements all the basic features of an HTTP/HTTPS proxy, in only 260 lines of C
code.
Another very simple implementation can be found at Proxy
.
A proxy server for what protocol? Before you know that, starting coding is not the most beneficial next step.
After you've decided on what protocol to implement, you (probably) need to read up on the sockets API.
Once that's done, there's three major routes to go, using a poll/select-based loop, forking off per-session processes or using threads to shuffle data.