1CURLOPT_NOPROXY(3)         curl_easy_setopt options         CURLOPT_NOPROXY(3)
2
3
4

NAME

6       CURLOPT_NOPROXY - disable proxy use for specific hosts
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode    curl_easy_setopt(CURL    *handle,   CURLOPT_NOPROXY,   char
12       *noproxy);
13

DESCRIPTION

15       Pass a pointer to a zero terminated string. The string  consists  of  a
16       comma  separated  list of host names that do not require a proxy to get
17       reached, even if one is specified.  The only wildcard  available  is  a
18       single  *  character, which matches all hosts, and effectively disables
19       the proxy. Each name in this list is matched as either a  domain  which
20       contains the hostname, or the hostname itself. For example, example.com
21       would match example.com, example.com:80, and www.example.com,  but  not
22       www.notanexample.com or example.com.othertld.
23
24       If  the  name  in the noproxy list has a leading period, it is a domain
25       match against the provided host  name.  This  way  ".example.com"  will
26       switch  off  proxy  use  for  both  "www.example.com"  as  well  as for
27       "foo.example.com".
28
29       Setting the noproxy string to ""  (an  empty  string)  will  explicitly
30       enable  the  proxy  for all host names, even if there is an environment
31       variable set for it.
32
33       Enter IPv6 numerical addresses  in  the  list  of  host  names  without
34       enclosing brackets:
35
36        "example.com,::1,localhost"
37
38       The  application  does not have to keep the string around after setting
39       this option.
40

Environment variables

42       If there's an environment variable called no_proxy  (or  NO_PROXY),  it
43       will  be  used  if  the  CURLOPT_NOPROXY(3) option is not set. It works
44       exactly the same way.
45

DEFAULT

47       NULL
48

PROTOCOLS

50       Most
51

EXAMPLE

53       CURL *curl = curl_easy_init();
54       if(curl) {
55         /* accept various URLs */
56         curl_easy_setopt(curl, CURLOPT_URL, input);
57         /* use this proxy */
58         curl_easy_setopt(curl, CURLOPT_PROXY, "http://proxy:80");
59         /* ... but make sure this host name is not proxied */
60         curl_easy_setopt(curl, CURLOPT_NOPROXY, "www.example.com");
61         curl_easy_perform(curl);
62       }
63

AVAILABILITY

65       Added in 7.19.4
66

RETURN VALUE

68       Returns CURLE_OK if the option is  supported,  CURLE_UNKNOWN_OPTION  if
69       not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space.
70

SEE ALSO

72       CURLOPT_PROXY(3), CURLOPT_PROXYAUTH(3),
73
74
75
76libcurl 7.61.1                  August 24, 2018             CURLOPT_NOPROXY(3)
Impressum