ITPub博客

首页 > Linux操作系统 > Linux操作系统 > A python proxy in less than 100 lines of code

A python proxy in less than 100 lines of code

原创 Linux操作系统 作者:jieforest 时间:2012-09-02 07:47:01 0 删除 编辑
What is a tcp proxy?

It's a intermediary server intended to act in name of a client, and sometimes to do something useful with the data before it reaches the original target. Let's see a picture:



My idea was to produce a proxy using only the default python library, and to guide me during development I set the following:

1. Each new client connection to our proxy must generate a new connection to the original target.
2. Each data packet that reaches our proxy must be forwarded to the original target.
3. Each data packet received from the target must be sent back to the correct client
4. The proxy must accept multiple clients
5. Must be fast
6. Must have a low resource usage


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/301743/viewspace-742455/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: Pythy syntax for C++11
请登录后发表评论 登录
全部评论

注册时间:2008-04-23

  • 博文量
    441
  • 访问量
    602353