HTTP proxy server

2019-03-20 17:15发布

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.

2条回答
劫难
2楼-- · 2019-03-20 17:36

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.

查看更多
Melony?
3楼-- · 2019-03-20 17:47

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.

查看更多
登录 后发表回答