GNURLOPT_HAPROXYPROTOCOL(3)
π GNURLOPT_HAPROXYPROTOCOL(3) π
okay bestie, welcome to the curl_easy_setopt options corner β this page is literally all about CURLOPT_HAPROXYPROTOCOL, and it's giving very specific test-request energy.
β¨ NAME β¨
CURLOPT_HAPROXYPROTOCOL β send HAProxy PROXY protocol v1 header. no cap, that's the whole name vibe. π
π¦ SYNOPSIS π¦
okay so you pull in the header, then call curl_easy_setopt like this:
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HAPROXYPROTOCOL,
long haproxy_protocol);
π DESCRIPTION π
Here's the tea: you pass a long parameter set to 1, and the library will send an HAProxy PROXY protocol v1 header at the beginning of the connection. The default action? Not sending this header at all β she's lowkey minding her business. π
This option is primarily useful when you're sending test requests to a service that expects this header. iykyk. π§
Most applications do not need this option. fr fr, don't reach for it unless you know you need it.
πΈ DEFAULT πΈ
0β do not send any HAProxy PROXY protocol header. simple as that. π
π PROTOCOLS π
- HTTP β that's the protocol club for this option. β¨
π₯ EXAMPLE π₯
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);
}
β AVAILABILITY β
Along with HTTP. Added in 7.60.0. periodt. π
π«Ά RETURN VALUE π«Ά
Returns CURLE_OK if HTTP is enabled, and CURLE_UNKNOWN_OPTION if not. that's the whole mood. π
and that's the page, bestie β signing off from libcurl 7.60.0, dated 5 Feb 2018, with main-character energy for GNURLOPT_HAPROXYPROTOCOL(3) πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms