CURLOPT_PROXYTYPE(3)
π CURLOPT_PROXYTYPE(3) β like, the proxy protocol type, bestie β¨
so this is a page from the Library Functions Manual (libcurl, obvi π) and it's all about telling curl what kind of proxy it's talking to. let's get into it π«Ά
β¨ NAME β¨
CURLOPT_PROXYTYPE β the proxy protocol type, periodt π
πΈ SYNOPSIS πΈ
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYTYPE, long type);
that's the whole vibe check right there π
π DESCRIPTION π
okay so you literally just pass one of the values below and that sets the type of the proxy. that's it. that's the whole thing β¨
CURLPROXY_HTTPβ HTTP Proxy. and yeah, it's the default πCURLPROXY_HTTPSβ HTTPS Proxy using HTTP/1. (added in 7.52.0 for OpenSSL and GnuTLS. and since 7.87.0, it also works for mbedTLS, Rustls, Schannel and wolfSSL β glow up fr π)CURLPROXY_HTTPS2β HTTPS Proxy AND it attempts to speak HTTP/2 over it. (added in 8.1.0, iconic behavior π₯)CURLPROXY_HTTP_1_0β HTTP 1.0 Proxy. this one's similar toCURLPROXY_HTTPexcept it uses HTTP/1.0 for any CONNECT tunneling. important: it does not change the HTTP version of the actual HTTP requests β that's controlled byCURLOPT_HTTP_VERSION(3)π«ΆCURLPROXY_SOCKS4β SOCKS4 Proxy.CURLPROXY_SOCKS4Aβ SOCKS4a Proxy. the proxy resolves the URL hostname π§CURLPROXY_SOCKS5β SOCKS5 Proxy.CURLPROXY_SOCKS5_HOSTNAMEβ SOCKS5 Proxy. again, the proxy resolves the URL hostname π§
lowkey often it is way more convenient to specify the proxy type with the scheme part of the CURLOPT_PROXY(3) string. iykyk π
π DEFAULT π
CURLPROXY_HTTP
the classic. the main character. the default β
π¦ PROTOCOLS π¦
this functionality affects all supported protocols β yes, all of them, no cap π
πΈ EXAMPLE πΈ
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
curl_easy_setopt(curl, CURLOPT_PROXY, "local.example.com:1080");
/* set the proxy type */
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
look at that. URL set, proxy set, type set, perform, cleanup. clean. ate. no crumbs π
π HISTORY π
the CURLPROXY_* enums became long types in 8.16.0. before that version, a long cast was necessary when passed to curl_easy_setopt(3) β so like, don't get caught slipping on old versions π
π AVAILABILITY π
added in curl 7.10 β
β¨ RETURN VALUE β¨
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK π β non-zero means an error occurred, see libcurl-errors(3) for the full tea π
π«Ά SEE ALSO π«Ά
that's the whole page bestie, go configure some proxies responsibly π
libcurl Β· 2026-10-12 Β· mwah, luv u, bye ππ π
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms