MagicStack / MagicStack/httptools
PROXY protocol v1 / v2 support
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 1.3k
- 派生
- 107
- PR 合并指标
- 30 天内没有已合并 PR
描述
Behind a reverse-proxy or a load balancer, you often need to get the original client IP.
A lot of load balancer provide these information with the PROXY protocol - HAproxy for exemple.
I have a load balancer that provide only this method to get the client info, and I would not be the only one.
Here a doc of the protocol: http://www.haproxy.org/download/2.4/doc/proxy-protocol.txt
In a nutshell, it's one line added on top of the body, here for the v1 protocol:
PROXY TCP4 192.168.0.1 192.168.0.11 56324 443\r\n
GET / HTTP/1.1\r\n
Host: 192.168.0.11\r\n
\r\n
This protocol is implemented in Gunicorn, and can be activated with --proxy-protocol: https://docs.gunicorn.org/en/stable/settings.html#proxy-protocol
edit: A NodeJS parser: https://github.com/racker/node-proxy-protocol/blob/master/index.js
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
未指定任何 repository 文件或测试。首先阅读链接的 HAProxy PROXY protocol 规范,并比较 Gunicorn 的 --proxy-protocol 行为;完成应意味着 httptools 在 HTTP 请求之前支持所请求的 PROXY protocol v1 和 v2 客户端信息。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- networking
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100