问题
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.
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/1734572/http-proxy-server