MagicStack / MagicStack/httptools

PROXY protocol v1 / v2 support

オープン
#61 コメント 0 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リポジトリのファイルやテストは指定されていません。まず、リンク先の HAProxy PROXY protocol 仕様を読み、Gunicorn の --proxy-protocol の動作と比較してください。完了とは、httptools が HTTP リクエストの前に、要求された PROXY protocol v1 および v2 のクライアント情報をサポートすることを意味します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
networking
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。