1CURLOPT_NOPROXY(3) libcurl CURLOPT_NOPROXY(3)
2
3
4
6 CURLOPT_NOPROXY - disable proxy use for specific hosts
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_NOPROXY, char *noproxy);
12
14 Pass a pointer to a null-terminated string. The string consists of a
15 comma separated list of host names that do not require a proxy to get
16 reached, even if one is specified. The only wildcard available is a
17 single * character, which matches all hosts, and effectively disables
18 the proxy. Each name in this list is matched as either a domain which
19 contains the hostname, or the hostname itself. For example, "ample.com"
20 would match ample.com, ample.com:80, and www.ample.com, but not www.ex‐
21 ample.com or ample.com.org.
22
23 Setting the noproxy string to "" (an empty string) will explicitly en‐
24 able the proxy for all host names, even if there is an environment
25 variable set for it.
26
27 Enter IPv6 numerical addresses in the list of host names without en‐
28 closing brackets:
29
30 "example.com,::1,localhost"
31
32 Since 7.86.0, IP addresses specified to this option can be provided us‐
33 ing CIDR notation: an appended slash and number specifies the number of
34 "network bits" out of the address to use in the comparison. For example
35 "192.168.0.0/16" would match all addresses starting with "192.168".
36
37 The application does not have to keep the string around after setting
38 this option.
39
41 If there's an environment variable called no_proxy (or NO_PROXY), it
42 will be used if the CURLOPT_NOPROXY(3) option is not set. It works ex‐
43 actly the same way.
44
46 NULL
47
49 Most
50
52 CURL *curl = curl_easy_init();
53 if(curl) {
54 /* accept various URLs */
55 curl_easy_setopt(curl, CURLOPT_URL, input);
56 /* use this proxy */
57 curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy:80");
58 /* ... but make sure this host name is not proxied */
59 curl_easy_setopt(curl, CURLOPT_NOPROXY, "www.example.com");
60 curl_easy_perform(curl);
61 }
62
64 Added in 7.19.4
65
67 Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if
68 not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space.
69
71 CURLOPT_PROXY(3), CURLOPT_PROXYAUTH(3),
72
73
74
75ibcurl 8.2.1 April 26, 2023 CURLOPT_NOPROXY(3)