1CURLOPT_HAPROXY_CLIENT_IP(3)        libcurl       CURLOPT_HAPROXY_CLIENT_IP(3)
2
3
4

NAME

6       CURLOPT_HAPROXY_CLIENT_IP - set HAProxy PROXY protocol client IP
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HAPROXY_CLIENT_IP,
12                                 char *client_ip);
13

DESCRIPTION

15       When  this  parameter  is set to a valid IPv4 or IPv6, the library will
16       not send this address in the HAProxy PROXY protocol v1 header at beginā€
17       ning of the connection.
18
19       This  option  is  primarily useful when sending test requests to verify
20       that a service is working as intended.
21
22

DEFAULT

24       no HAProxy header will be sent
25

PROTOCOLS

27       HTTP, HAProxy PROTOCOL
28

EXAMPLE

30       CURL *curl = curl_easy_init();
31       if(curl) {
32         CURLcode ret;
33         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
34         curl_easy_setopt(curl, CURLOPT_HAPROXY_CLIENT_IP, "1.1.1.1");
35         ret = curl_easy_perform(curl);
36       }
37

AVAILABILITY

39       Along with HTTP. Added in 8.2.0.
40

RETURN VALUE

42       Returns CURLE_OK if HTTP is enabled, and CURLE_UNKNOWN_OPTION if not.
43

SEE ALSO

45       CURLOPT_PROXY(3), CURLOPT_HAPROXYPROTOCOL(3),
46
47
48
49ibcurl 8.2.1                    March 16, 2023    CURLOPT_HAPROXY_CLIENT_IP(3)
Impressum