CURLOPT_HAPROXYPROTOCOL.3 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. .\" generated by cd2nroff 0.1 from CURLOPT_HAPROXYPROTOCOL.md
  2. .TH CURLOPT_HAPROXYPROTOCOL 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_HAPROXYPROTOCOL \- send HAProxy PROXY protocol v1 header
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HAPROXYPROTOCOL,
  9. long haproxy_protocol);
  10. .fi
  11. .SH DESCRIPTION
  12. A long parameter set to 1 tells the library to send an HAProxy PROXY
  13. protocol v1 header at beginning of the connection. The default action is not to
  14. send this header.
  15. This option is primarily useful when sending test requests to a service that
  16. expects this header.
  17. Most applications do not need this option.
  18. .SH DEFAULT
  19. 0, do not send any HAProxy PROXY protocol header
  20. .SH PROTOCOLS
  21. This functionality affects all supported protocols
  22. .SH EXAMPLE
  23. .nf
  24. int main(void)
  25. {
  26. CURL *curl = curl_easy_init();
  27. if(curl) {
  28. CURLcode ret;
  29. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  30. curl_easy_setopt(curl, CURLOPT_HAPROXYPROTOCOL, 1L);
  31. ret = curl_easy_perform(curl);
  32. }
  33. }
  34. .fi
  35. .SH AVAILABILITY
  36. Added in curl 7.60.0
  37. .SH RETURN VALUE
  38. Returns CURLE_OK if HTTP is enabled, and CURLE_UNKNOWN_OPTION if not.
  39. .SH SEE ALSO
  40. .BR CURLOPT_PROXY (3)