Revert "Imported Upstream version 7.44.0"
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_PROXY.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2  "http://www.w3.org/TR/html4/loose.dtd">
3 <html><head>
4 <title>CURLOPT_PROXY man page</title>
5 <meta name="generator" content="roffit">
6 <STYLE type="text/css">
7 P.level0 {
8  padding-left: 2em;
9 }
10
11 P.level1 {
12  padding-left: 4em;
13 }
14
15 P.level2 {
16  padding-left: 6em;
17 }
18
19 span.emphasis {
20  font-style: italic;
21 }
22
23 span.bold {
24  font-weight: bold;
25 }
26
27 span.manpage {
28  font-weight: bold;
29 }
30
31 h2.nroffsh {
32  background-color: #e0e0e0;
33 }
34
35 span.nroffip {
36  font-weight: bold;
37  font-size: 120%;
38  font-family: monospace;
39 }
40
41 p.roffit {
42  text-align: center;
43  font-size: 80%;
44 }
45 </STYLE>
46 </head><body>
47
48 <p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
49 <p class="level0">CURLOPT_PROXY - set proxy to use <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
50 <p class="level0">#include &lt;curl/curl.h&gt; 
51 <p class="level0">CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY, char *proxy); <a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
52 <p class="level0">Set the <span Class="emphasis">proxy</span> to use for the upcoming request. The parameter should be a char * to a zero terminated string holding the host name or dotted IP address. 
53 <p class="level0">To specify port number in this string, append :[port] to the end of the host name. The proxy's port number may optionally be specified with the separate option <a Class="emphasis" href="./CURLOPT_PROXYPORT.html">CURLOPT_PROXYPORT</a>. If not specified, libcurl will default to using port 1080 for proxies. 
54 <p class="level0">The proxy string may be prefixed with [scheme]:// to specify which kind of proxy is used. Use socks4://, socks4a://, socks5:// or socks5h:// (the last one to enable socks5 and asking the proxy to do the resolving, also known as <span Class="emphasis">CURLPROXY_SOCKS5_HOSTNAME</span> type) to request the specific SOCKS version to be used. No protocol specified, http:// and all others will be treated as HTTP proxies. 
55 <p class="level0">Without a scheme prefix, <a Class="emphasis" href="./CURLOPT_PROXYTYPE.html">CURLOPT_PROXYTYPE</a> can be used to specify which kind of proxy the string identifies. 
56 <p class="level0">When you tell the library to use a HTTP proxy, libcurl will transparently convert operations to HTTP even if you specify an FTP URL etc. This may have an impact on what other features of the library you can use, such as <a Class="emphasis" href="./CURLOPT_QUOTE.html">CURLOPT_QUOTE</a> and similar FTP specifics that don't work unless you tunnel through the HTTP proxy. Such tunneling is activated with <a Class="emphasis" href="./CURLOPT_HTTPPROXYTUNNEL.html">CURLOPT_HTTPPROXYTUNNEL</a>. 
57 <p class="level0">libcurl respects the environment variables <span Class="bold">http_proxy</span>, <span Class="bold">ftp_proxy</span>, <span Class="bold">all_proxy</span> etc, if any of those are set. The <a Class="emphasis" href="./CURLOPT_PROXY.html">CURLOPT_PROXY</a> option does however override any possibly set environment variables. 
58 <p class="level0">Setting the proxy string to "" (an empty string) will explicitly disable the use of a proxy, even if there is an environment variable set for it. 
59 <p class="level0">A proxy host string given in an environment variable can also include protocol scheme (http://) and embedded user + password. <a name="DEFAULT"></a><h2 class="nroffsh">DEFAULT</h2>
60 <p class="level0">Default is NULL, meaning no proxy is used. 
61 <p class="level0">When you set a host name to use, do not assume that there's any particular single port number used widely for proxies. Specify it! <a name="PROTOCOLS"></a><h2 class="nroffsh">PROTOCOLS</h2>
62 <p class="level0">All except file://. Note that some protocols don't do very well over proxy. <a name="EXAMPLE"></a><h2 class="nroffsh">EXAMPLE</h2>
63 <p class="level0">TODO <a name="AVAILABILITY"></a><h2 class="nroffsh">AVAILABILITY</h2>
64 <p class="level0">Since 7.14.1 the proxy environment variable names can include the protocol scheme. 
65 <p class="level0">Since 7.21.7 the proxy string supports the socks protocols as "schemes". <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>
66 <p class="level0">Returns CURLE_OK if proxies are supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. <a name="SEE"></a><h2 class="nroffsh">SEE ALSO</h2>
67 <p class="level0"><a Class="manpage" href="./CURLOPT_PROXYPORT.html">CURLOPT_PROXYPORT</a>, <a Class="manpage" href="./CURLOPT_HTTPPROXYTUNNEL.html">CURLOPT_HTTPPROXYTUNNEL</a>, <span Class="manpage"> </span> <a Class="manpage" href="./CURLOPT_PROXYTYPE.html">CURLOPT_PROXYTYPE</a>, <p class="roffit">
68  This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
69 </body></html>