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

@ -122,6 +122,7 @@ static const struct LongShort aliases[]= {
{"*x", "krb4", ARG_STRING},
/* 'krb4' is the previous name */
{"*X", "haproxy-protocol", ARG_BOOL},
{"*P", "haproxy-clientip", ARG_STRING},
{"*y", "max-filesize", ARG_STRING},
{"*z", "disable-eprt", ARG_BOOL},
{"*Z", "eprt", ARG_BOOL},
@ -1055,6 +1056,9 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
case 'X': /* --haproxy-protocol */
config->haproxy_protocol = toggle;
break;
case 'P': /* --haproxy-clientip */
GetStr(&config->haproxy_clientip, nextarg);
break;
case 'y': /* --max-filesize */
{
curl_off_t value;