Hi Cyril.

------ Originalnachricht ------
Von: "Cyril Bonté" <cyril.bo...@free.fr>
An: "Aleksandar Lazic" <al-hapr...@none.at>
Cc: haproxy@formilux.org
Gesendet: 22.01.2018 14:12:30
Betreff: Re: Re[4]: How to parse custom PROXY protocol v2 header for custom routing in HAProxy configuration?

Hi,

----- Mail original -----
De: "Aleksandar Lazic" <al-hapr...@none.at>
À: haproxy@formilux.org
Envoyé: Lundi 22 Janvier 2018 13:34:33
Objet: Re[4]: How to parse custom PROXY protocol v2 header for custom routing in HAProxy configuration?

Hi.

Have anyone a Idea how haproxy can handle the custom TLV in the proxy
protocol v2

Currently, it can't. Only PP2_TYPE_NETNS is supported.
But some work can be done to, at least, support some other predefined fields, or even better, to provide a generic way to capture any type of field.

You can have a look at the function conn_recv_proxy() in src/connection.c :
http://git.haproxy.org/?p=haproxy.git;a=blob;f=src/connection.c;h=0f8acb02dbdbc0a70cdd99830f8a0c9256f731e8;hb=HEAD#l604

Thanks for answer.

I have read the doc to the proxy-protocol and hopfully understand it.
I try to describe the required steps to add that feature into haproxy.
Please correct me where I'm wrong. I refer to this part of the doc.

http://www.haproxy.org/download/1.9/doc/proxy-protocol.txt

###
2.2.7. Reserved type ranges

The following range of 16 type values is reserved for application-specific data and will be never used by the PROXY Protocol. If you need more values
consider extending the range with a type field in your TLVs.

        #define PP2_TYPE_MIN_CUSTOM 0xE0
        #define PP2_TYPE_MAX_CUSTOM 0xEF
..
##

1.) Add a custom list struct in *struct connection*
http://git.haproxy.org/?p=haproxy.git;a=blob;f=include/types/connection.h;hb=HEAD#l360

2.) Init the custom list struct in ...?
3.) Add the custom field parsing in

http://git.haproxy.org/?p=haproxy.git;a=blob;f=src/connection.c;h=0f8acb02dbdbc0a70cdd99830f8a0c9256f731e8;hb=HEAD#l604

4.) create a fetch method in ...?
5.) add this custom list struct to lua interface.
6.) create a test case in 'tests' dir.


Cyril

Due to the fact that I haven't written code in that low level for some time in C I hope that someone pick up the task ;-) I know it's not a easy task therefore keep in in the mail archive and when someone have some time an leisure they maybe pick it up. Cool would be when AWS sponsor this development as they use it already in there platform ;-)

https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#proxy-protocol

Regards

Aleks

Reply via email to