Add proxy protocol support

Adds a server-specific parameter, "use_proxy_protocol". If enabled,
a header string is sent to the backend when a routing session connection
changes state to MXS_AUTH_STATE_CONNECTED. The string contains the real
client IP and port.
This commit is contained in:
Esa Korhonen
2017-04-20 10:48:08 +03:00
parent deb11ae6eb
commit 8f50269338
4 changed files with 163 additions and 0 deletions

View File

@ -94,6 +94,7 @@ typedef struct server
uint8_t charset; /**< Default server character set */
bool is_active; /**< Server is active and has not been "destroyed" */
bool created_online; /**< Whether this server was created after startup */
bool use_proxy_protocol; /**< Send proxy-protocol header when connecting client sessions. */
#if defined(SS_DEBUG)
skygw_chk_t server_chk_tail;
#endif
@ -190,6 +191,8 @@ enum
(((server)->status & (SERVER_RUNNING|SERVER_MASTER|SERVER_SLAVE|SERVER_MAINT)) == \
(SERVER_RUNNING|SERVER_MASTER|SERVER_SLAVE))
extern const char USE_PROXY_PROTOCOL[];
/**
* @brief Allocate a new server
*