1CURLOPT_PROXYTYPE(3)                libcurl               CURLOPT_PROXYTYPE(3)
2
3
4

NAME

6       CURLOPT_PROXYTYPE - proxy protocol type
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYTYPE, long type);
12

DESCRIPTION

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  using HTTP/1. (Added in 7.52.0 for OpenSSL,
22                     GnuTLS and NSS. Since 7.87.0, it also works for  BearSSL,
23                     mbedTLS, rustls, Schannel, Secure Transport and wolfSSL.)
24
25              CURLPROXY_HTTPS2
26                     HTTPS  Proxy  and attempt to speak HTTP/2 over it. (Added
27                     in 8.1.0)
28
29              CURLPROXY_HTTP_1_0
30                     HTTP 1.0 Proxy. This is similar to CURLPROXY_HTTP  except
31                     it  uses  HTTP/1.0 for any CONNECT tunneling. It does not
32                     change the HTTP version of the actual HTTP requests, con‐
33                     trolled by CURLOPT_HTTP_VERSION(3).
34
35              CURLPROXY_SOCKS4
36                     SOCKS4 Proxy.
37
38              CURLPROXY_SOCKS4A
39                     SOCKS4a Proxy. Proxy resolves URL hostname.
40
41              CURLPROXY_SOCKS5
42                     SOCKS5 Proxy.
43
44              CURLPROXY_SOCKS5_HOSTNAME
45                     SOCKS5 Proxy. Proxy resolves URL hostname.
46
47       Often  it  is more convenient to specify the proxy type with the scheme
48       part of the CURLOPT_PROXY(3) string.
49

DEFAULT

51       CURLPROXY_HTTP
52

PROTOCOLS

54       Most
55

EXAMPLE

57       CURL *curl = curl_easy_init();
58       if(curl) {
59         CURLcode ret;
60         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
61         curl_easy_setopt(curl, CURLOPT_PROXY, "local.example.com:1080");
62         /* set the proxy type */
63         curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
64         ret = curl_easy_perform(curl);
65         curl_easy_cleanup(curl);
66       }
67

AVAILABILITY

69       Always
70

RETURN VALUE

72       Returns CURLE_OK
73

SEE ALSO

75       CURLOPT_PROXY(3), CURLOPT_PROXYPORT(3),
76
77
78
79ibcurl 8.2.1                    April 26, 2023            CURLOPT_PROXYTYPE(3)
Impressum