1CURLOPT_HAPROXYPROTOCOL(3) curl_easy_setopt options CURLOPT_HAPROXYPROTOCOL(3)
2
3
4

NAME

6       CURLOPT_HAPROXYPROTOCOL - send HAProxy PROXY protocol v1 header
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HAPROXYPROTOCOL,
12                                 long haproxy_protocol);
13

DESCRIPTION

15       A  long  parameter  set to 1 tells the library to send an HAProxy PROXY
16       protocol v1 header at beginning of the connection. The  default  action
17       is not to send this header.
18
19       This option is primarily useful when sending test requests to a service
20       that expects this header.
21
22       Most applications do not need this option.
23

DEFAULT

25       0, do not send any HAProxy PROXY protocol header
26

PROTOCOLS

28       HTTP
29

EXAMPLE

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

AVAILABILITY

40       Along with HTTP. Added in 7.60.0.
41

RETURN VALUE

43       Returns CURLE_OK if HTTP is enabled, and CURLE_UNKNOWN_OPTION if not.
44
45
46
47libcurl 7.64.0                   May 18, 2018       CURLOPT_HAPROXYPROTOCOL(3)
Impressum