CURLOPT_HAPROXY_CLIENT_IP.3 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. .\" generated by cd2nroff 0.1 from CURLOPT_HAPROXY_CLIENT_IP.md
  2. .TH CURLOPT_HAPROXY_CLIENT_IP 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_HAPROXY_CLIENT_IP \- set HAProxy PROXY protocol client IP
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HAPROXY_CLIENT_IP,
  9. char *client_ip);
  10. .fi
  11. .SH DESCRIPTION
  12. When this parameter is set to a valid IPv4 or IPv6 numerical address, the
  13. library sends this address as client address in the HAProxy PROXY protocol v1
  14. header at beginning of the connection.
  15. This option is an alternative to \fICURLOPT_HAPROXYPROTOCOL(3)\fP as that one
  16. cannot use a specified address.
  17. .SH DEFAULT
  18. NULL, no HAProxy header is sent
  19. .SH PROTOCOLS
  20. This functionality affects all supported protocols
  21. .SH EXAMPLE
  22. .nf
  23. int main(void)
  24. {
  25. CURL *curl = curl_easy_init();
  26. if(curl) {
  27. CURLcode ret;
  28. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  29. curl_easy_setopt(curl, CURLOPT_HAPROXY_CLIENT_IP, "1.1.1.1");
  30. ret = curl_easy_perform(curl);
  31. }
  32. }
  33. .fi
  34. .SH AVAILABILITY
  35. Added in curl 8.2.0
  36. .SH RETURN VALUE
  37. Returns CURLE_OK if HTTP is enabled, and CURLE_UNKNOWN_OPTION if not.
  38. .SH SEE ALSO
  39. .BR CURLOPT_HAPROXYPROTOCOL (3),
  40. .BR CURLOPT_PROXY (3)