1CURLOPT_PROXYTYPE(3) curl_easy_setopt options CURLOPT_PROXYTYPE(3)
2
3
4
6 CURLOPT_PROXYTYPE - proxy protocol type
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYTYPE, long type);
12
14 Pass one of the values below to set the type of the proxy.
15
16
17 CURLPROXY_HTTP
18 HTTP Proxy. Default.
19
20 CURLPROXY_HTTPS
21 HTTPS Proxy. (Added in 7.52.0 for OpenSSL, GnuTLS and
22 NSS)
23
24 CURLPROXY_HTTP_1_0
25 HTTP 1.0 Proxy. This is similar to CURLPROXY_HTTP except
26 it uses HTTP/1.0 for any CONNECT tunnelling. It does not
27 change the HTTP version of the actual HTTP requests, con‐
28 trolled by CURLOPT_HTTP_VERSION(3).
29
30 CURLPROXY_SOCKS4
31 SOCKS4 Proxy.
32
33 CURLPROXY_SOCKS4A
34 SOCKS4a Proxy. Proxy resolves URL hostname.
35
36 CURLPROXY_SOCKS5
37 SOCKS5 Proxy.
38
39 CURLPROXY_SOCKS5_HOSTNAME
40 SOCKS5 Proxy. Proxy resolves URL hostname.
41
42 Often it is more convenient to specify the proxy type with the scheme
43 part of the CURLOPT_PROXY(3) string.
44
46 CURLPROXY_HTTP
47
49 Most
50
52 CURL *curl = curl_easy_init();
53 if(curl) {
54 CURLcode ret;
55 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
56 curl_easy_setopt(curl, CURLOPT_PROXY, "local.example.com:1080");
57 /* set the proxy type */
58 curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
59 ret = curl_easy_perform(curl);
60 curl_easy_cleanup(curl);
61 }
62
64 Always
65
67 Returns CURLE_OK
68
70 CURLOPT_PROXY(3), CURLOPT_PROXYPORT(3),
71
72
73
74libcurl 7.82.0 November 26, 2021 CURLOPT_PROXYTYPE(3)