CURLOPT_PROXY
) to match it:socks4
- means SOCKS4 with local name resolvingsocks4a
- means SOCKS4 with proxy's name resolvingsocks5
- means SOCKS5 with local name resolvingsocks5h
- means SOCKS5 with proxy's name resolvinghttp
- means HTTP, which always lets the proxy resolve nameshttps
- means HTTPS to the proxy, which always lets the proxy resolve names (Note that HTTPS proxy support was added recently, in curl 7.52.0, and it still only works with a subset of the TLS libraries: OpenSSL, GnuTLS and NSS.)CURLOPT_PROXYTYPE
. Similarly, you can set the proxy port number to use with CURLOPT_PROXYPORT
.[scheme]_proxy
to hold the proxy host name (the same way you would specify the host with -x
). So if you want to tell curl to use a proxy when accessing an HTTP server, you set the http_proxy
environment variable. Like this:ftp_proxy
, https_proxy
, and so on for the specific protocols you want to proxy. All these proxy environment variable names except http_proxy can also be specified in uppercase, like HTTPS_PROXY
.ALL_PROXY
exists. If a specific protocol variable one exists, such a one will take precedence.NO_PROXY
variable - or the corresponding CURLOPT_NOPROXY
libcurl option. Set that to a comma-separated list of host names that should not use a proxy when being accessed. You can set NO_PROXY to be a single asterisk ('*') to match all hosts.CONNECT
request to the proxy. Such a request opens a tunnel through the proxy, where it passes data through without understanding it. This way, libcurl can establish a secure end-to-end TLS connection even when an HTTP proxy is present.CURLOPT_PROXY_CAINFO
is the same functionality for the HTTPS proxy as CURLOPT_CAINFO
is for the remote host. CURLOPT_PROXY_SSL_VERIFYPEER
is the proxy version of CURLOPT_SSL_VERIFYPEER
and so on.CURLOPT_PROXYUSERPWD
which sets the user name and password to use - unless you set it within the CURLOPT_PROXY
string.CURLOPT_PROXYHEADER
for controlling the headers that are sent to a proxy when there is a separate request sent to the server. This typically means the initial CONNECT
request sent to a proxy for setting up a tunnel through the proxy.