CURLOPT_HAPROXYPROTOCOL(3)

CURLOPT_HAPROXYPROTOCOL3

Send haproxy proxy protocol v1 header

Usage

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

Overview

A long parameter set to 1 tells the library to send an HAProxy PROXY protocol v1 header at beginning of the connection. The default action is not to send this header.

This option is primarily useful when sending test requests to a service that expects this header.

Most applications do not need this option.

Default

0, do not send any HAProxy PROXY protocol header

Protocols

HTTP

Examples

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    CURLcode ret;
    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
    curl_easy_setopt(curl, CURLOPT_HAPROXYPROTOCOL, 1L);
    ret = curl_easy_perform(curl);
  }
}

Return value

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

Releases

32 releases since macOS 12.0.1; the text changed 9 times.

  1. 12.0.1–12.2
  2. 12.3–12.5
  3. 13.0
  4. 13.1
  5. 13.2
  6. 13.3
  7. 13.4
  8. 13.5–14.1
  9. 14.2–14.4
  10. 14.5–26.5

Availability

Along with HTTP. Added in 7.60.0.

From curl 166.0.0.0.1 in macOS 26.5. Parsed by carta from the page's man source.