haproxy: add --haproxy-clientip flag to spoof client IPs

CURLOPT_HAPROXY_CLIENT_IP in the library

Closes #10779
This commit is contained in:
Raito Bezarius 2023-03-16 14:20:11 +01:00 committed by Daniel Stenberg
parent 9ad23c38e5
commit 0a75964d0d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
21 changed files with 267 additions and 4 deletions

View file

@ -2161,6 +2161,11 @@ static CURLcode single_transfer(struct GlobalConfig *global,
if(config->haproxy_protocol)
my_setopt(curl, CURLOPT_HAPROXYPROTOCOL, 1L);
/* new in 8.2.0 */
if(config->haproxy_clientip)
my_setopt_str(curl, CURLOPT_HAPROXY_CLIENT_IP,
config->haproxy_clientip);
if(config->disallow_username_in_url)
my_setopt(curl, CURLOPT_DISALLOW_USERNAME_IN_URL, 1L);