MagicStack / MagicStack/httptools
PROXY protocol v1 / v2 support
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.3k
- Forks
- 107
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository files or tests are named. Start by reading the linked HAProxy PROXY protocol specification and comparing Gunicorn's --proxy-protocol behavior; done should mean httptools supports the requested PROXY protocol v1 and v2 client information before the HTTP request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100