GNURLOPT_PROXYTYPE(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’… GNURLOPT_PROXYTYPE(3) β€” the proxy-protocol-type girly πŸ’…

okay so bestie, welcome to the gnurl curl_easy_setopt options page ✨ this is GNURLOPT_PROXYTYPE(3) and it's literally all about telling gnurl what kind of proxy you're talking to. no cap, that's the whole vibe. πŸ¦‹


✨ NAME ✨

CURLOPT_PROXYTYPE β€” the proxy protocol type, periodt πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYTYPE, long type);

🌸 DESCRIPTION 🌸

okay so you pass one of the values below to type and that sets the type of the proxy πŸ’… like, which flavour of proxy your handle is gonna talk to. pick your fighter:

  • CURLPROXY_HTTP β€” HTTP Proxy. this one's the Default, she's the main character πŸ‘‘
  • CURLPROXY_HTTPS β€” HTTPS Proxy. (Added in 7.52.0 for OpenSSL, GnuTLS and NSS) πŸ”₯
  • CURLPROXY_HTTP_1_0 β€” HTTP 1.0 Proxy. this is very similar to CURLPROXY_HTTP except it uses HTTP/1.0 for any CONNECT tunnelling. it does not change the HTTP version of the actual HTTP requests, those are controlled by CURLOPT_HTTP_VERSION(3). so don't get it twisted bestie 🫢
  • CURLPROXY_SOCKS4 β€” SOCKS4 Proxy. 🧦
  • CURLPROXY_SOCKS4A β€” SOCKS4a Proxy. Proxy resolves URL hostname. 🧦✨
  • CURLPROXY_SOCKS5 β€” SOCKS5 Proxy. πŸ§¦πŸ’œ
  • CURLPROXY_SOCKS5_HOSTNAME β€” SOCKS5 Proxy. Proxy resolves URL hostname. 🧦🌺
ngl, often it is more convenient to specify the proxy type with the scheme part of the CURLOPT_PROXY(3) string. iykyk 😌

πŸ¦‹ DEFAULT πŸ¦‹

CURLPROXY_HTTP

(the default ate, no notes πŸ’€πŸ’–)


🌈 PROTOCOLS 🌈

Most


⭐ EXAMPLE ⭐

CURL *curl = curl_easy_init();
if(curl) {
  CURLcode ret;
  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);
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

look at her go πŸ˜­πŸ‘‘ set the URL, set the proxy, set the type (SOCKS5 up in here), perform, cleanup β€” chef's kiss πŸ“


πŸ”₯ AVAILABILITY πŸ”₯

Always

(like, always always. she's been here the whole time πŸ’…)


πŸ’€ RETURN VALUE πŸ’€

Returns CURLE_OK


🫢 SEE ALSO 🫢


k bye bestie, go set some proxy types πŸ’–βœ¨ this was libcurl 7.37.0, dated 17 Jun 2014, signing off πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from