CURLOPT_PROXYPORT(3)
π CURLOPT_PROXYPORT(3) π
okay bestie, quick vibe check: this is a page straight out of the Library Functions Manual, and it's all about CURLOPT_PROXYPORT β literally just the port number the proxy listens on. that's the whole assignment. π
β¨ NAME β¨
CURLOPT_PROXYPORT β the port number your proxy is chilling on π«Ά
πΈ SYNOPSIS πΈ
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYPORT, long port);
π¦ DESCRIPTION π¦
okay so first thing, no cap: we discourage use of this option. like, we're telling you this up front so you can't say we didn't warn you π
if you do use it, you pass a long with this option to set the proxy port to connect to β unless it's already specified in the proxy string CURLOPT_PROXY(3), or unless it uses 443 for https proxies and 1080 for all others as the default. iykyk π
disabling this option β meaning setting it to zero β makes it not specified, which makes libcurl use the default proxy port number, or the port number specified in the proxy URL string. so zero is basically the "idk, you pick" setting β¨
and here's the lil catch: while this accepts a long, the port number is 16 bit, so it cannot be larger than 65535. periodt. don't try it. π
π DEFAULT π
0
π PROTOCOLS π
this functionality affects all supported protocols π
π EXAMPLE π
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
curl_easy_setopt(curl, CURLOPT_PROXY, "localhost");
curl_easy_setopt(curl, CURLOPT_PROXYPORT, 8080L);
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
look at her go π she's setting the URL, setting the proxy to localhost, and telling it port 8080L β iconic behavior honestly π
β AVAILABILITY β
added in curl 7.1 β she's been around a minute, a real veteran π
π§ RETURN VALUE π§
curl_easy_setopt(3) returns a CURLcode indicating success or error β you know the drill.
CURLE_OK (0) means everything was OK, non-zero means an error occurred, see libcurl-errors(3). zero is the slay number, anything else is a cry for help π
π SEE ALSO π
go read those too, they're all in the same friend group fr fr π«Ά
and that's the whole page bestie!! this was libcurl, dated 2026-10-12 β mwah, see you in the next manpage π
β¨π
π¦ 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