CURLOPT_PROXYPORT.3 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PROXYPORT.md
  2. .TH CURLOPT_PROXYPORT 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PROXYPORT \- port number the proxy listens on
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYPORT, long port);
  9. .fi
  10. .SH DESCRIPTION
  11. We discourage use of this option.
  12. Pass a long with this option to set the proxy port to connect to unless it is
  13. specified in the proxy string \fICURLOPT_PROXY(3)\fP or uses 443 for https proxies
  14. and 1080 for all others as default.
  15. Disabling this option, setting it to zero, makes it not specified which makes
  16. libcurl use the default proxy port number or the port number specified in the
  17. proxy URL string.
  18. While this accepts a \(aqlong\(aq, the port number is 16 bit so it cannot be larger
  19. than 65535.
  20. .SH DEFAULT
  21. 0
  22. .SH PROTOCOLS
  23. This functionality affects all supported protocols
  24. .SH EXAMPLE
  25. .nf
  26. int main(void)
  27. {
  28. CURL *curl = curl_easy_init();
  29. if(curl) {
  30. CURLcode res;
  31. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
  32. curl_easy_setopt(curl, CURLOPT_PROXY, "localhost");
  33. curl_easy_setopt(curl, CURLOPT_PROXYPORT, 8080L);
  34. res = curl_easy_perform(curl);
  35. curl_easy_cleanup(curl);
  36. }
  37. }
  38. .fi
  39. .SH AVAILABILITY
  40. Added in curl 7.1
  41. .SH RETURN VALUE
  42. Returns CURLE_OK
  43. .SH SEE ALSO
  44. .BR CURLINFO_PRIMARY_PORT (3),
  45. .BR CURLOPT_PORT (3),
  46. .BR CURLOPT_PROXY (3),
  47. .BR CURLOPT_PROXYTYPE (3)