← Back to team overview

maria-developers team mailing list archive

Adding "proxy protocol" support to MariaDB



As you may know, the proxy protocol [1,2] is a way to communicate
a client's IP address to a backend server sitting behind a proxy
front-end. It is the equivalent of the X-Forwarded-For HTTP
header, but done at Layer 4.  This protocol was originally
proposed by one of the HAProxy developers and its support is
becoming more widespread. Percona, Amazon AWS, HAProxy, NGINX,
and others.

Mariadb's Jira shows an unassigned feature request for it, but
with no one apparently assigned to it [3].

Percona supports proxy protocol [4]. For the configuration part,
Percona defines a global variable that gives the IP address of
the proxy front-ends that are authorized to send a proxy protocol

Percona's handler code for the proxy protocol (minus the global
variable handling) is in the vio/viosockets.c file [4] I looked
at Percona's implementation. This file looks very similar to
MariaDb's own viosockets.c file [5] so it may a potential good
insertion point. Percona's software license seems to be permisive
enough for reusing / adapting their code [6].

Please correct me if I'm wrong but it seems no one is currently
working on this feature right now. I'd like to know 
if you would be interested in help side-porting 
Percona's proxy protocol code to MariaDB. I'll probably need 
some help or pointers on how to add a global
variable, though.

Best regards,


[1] Proxy protocol documentation

[2] Proxy protocol specification

[3] Mariadb feature request for proxy protocol

[3] Percona proxy protocol manual page

[4] Percona proxy protocol handler code

[5] mariadb potential insertion pode for proxy protocol code

[6] Percona software license

Follow ups