CURLOPT_NOPROXY.3 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. .\" generated by cd2nroff 0.1 from CURLOPT_NOPROXY.md
  2. .TH CURLOPT_NOPROXY 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_NOPROXY \- disable proxy use for specific hosts
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_NOPROXY, char *noproxy);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a pointer to a null\-terminated string. The string consists of a comma
  12. separated list of hostnames that do not require a proxy to get reached, even
  13. if one is specified. The only wildcard available is a single * character,
  14. which matches all hosts, and effectively disables the proxy. Each name in this
  15. list is matched as either a domain which contains the hostname, or the
  16. hostname itself. For example, "ample.com" would match ample.com, ample.com:80,
  17. and www.ample.com, but not www.example.com or ample.com.org.
  18. Setting the \fInoproxy\fP string to "" (an empty string) explicitly enables the
  19. proxy for all hostnames, even if there is an environment variable set for it.
  20. Enter IPv6 numerical addresses in the list of hostnames without enclosing
  21. brackets:
  22. \&"example.com,::1,localhost"
  23. Since 7.86.0, IP addresses specified to this option can be provided using CIDR
  24. notation: an appended slash and number specifies the number of "network bits"
  25. out of the address to use in the comparison. For example "192.168.0.0/16"
  26. would match all addresses starting with "192.168".
  27. The application does not have to keep the string around after setting this
  28. option.
  29. .SH Environment variables
  30. If there is an environment variable called \fBno_proxy\fP (or \fBNO_PROXY\fP),
  31. it is used if the \fICURLOPT_NOPROXY(3)\fP option is not set. It works exactly
  32. the same way.
  33. .SH DEFAULT
  34. NULL
  35. .SH PROTOCOLS
  36. This functionality affects all supported protocols
  37. .SH EXAMPLE
  38. .nf
  39. int main(void)
  40. {
  41. CURL *curl = curl_easy_init();
  42. if(curl) {
  43. /* accept various URLs */
  44. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  45. /* use this proxy */
  46. curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy:80");
  47. /* ... but make sure this host name is not proxied */
  48. curl_easy_setopt(curl, CURLOPT_NOPROXY, "www.example.com");
  49. curl_easy_perform(curl);
  50. }
  51. }
  52. .fi
  53. .SH AVAILABILITY
  54. Added in curl 7.19.4
  55. .SH RETURN VALUE
  56. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  57. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  58. .SH SEE ALSO
  59. .BR CURLOPT_PROXY (3),
  60. .BR CURLOPT_PROXYAUTH (3),
  61. .BR CURLOPT_PROXYTYPE (3)