GNURLOPT_PROXYPORT(3)
π
GNURLOPT_PROXYPORT(3) β like, the actual curl_easy_setopt options page, bestie
okay so real talk, this is one of the pages from the curl_easy_setopt options manual set, and it's about telling curl which port your proxy is vibing on. it's short, it's sweet, it's giving "one job and it does it" energy. let's go π«Ά
β¨ NAME β¨
CURLOPT_PROXYPORT β literally the port number your proxy listens on π
πΈ SYNOPSIS πΈ
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYPORT, long port);
π¦ DESCRIPTION π¦
okay so you pass a long with this option and that sets the proxy port to connect to β unless the port is already specified in the proxy string you gave to CURLOPT_PROXY(3), in which case that one wins. and if nobody specifies anything? it defaults to 443 for https proxies and 1080 for all others. slay, sensible defaults π
and listen, even though this thing accepts a long (big boi number), the port number is 16 bit, so it can't be larger than 65535. no cap. that's the ceiling, that's the whole ceiling. π
ok so genuinely important: 16 bit means 65535 is the max. don't come at it with a bigger number and expect it to work, bestie.
β OPTIONS β
CURLOPT_PROXYPORTβ thelongholding the proxy port you wanna connect to. overridden by whatever's in theCURLOPT_PROXY(3)string if that has a port in it. capped at65535because 16 bit. π
π DEFAULT π
0, which means it's not specified β so it just uses the default port. lowkey the most chill default ever. β¨
π PROTOCOLS π
All. every single one. equal opportunity proxy port. π«Ά
π§ EXAMPLE π§
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
curl_easy_setopt(curl, CURLOPT_PROXY, "localhost");
curl_easy_setopt(curl, CURLOPT_PROXYPORT, 8080L);
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
see how it's 8080L? that's the long doing its thing. don't forget the L, it's part of the aesthetic. and yes the example really does say ret without declaring it, that's just how the page is, i don't make the rules π
π AVAILABILITY π
Always. it's been here since forever, it's iconic, it's not going anywhere. π
π RETURN VALUE π
Returns CURLE_OK. that's it. that's the whole return value. no drama, no surprises, we love a low-maintenance icon. π
π SEE ALSO π
and that's the whole page, bestie!! π¦ so like, this was libcurl 7.37.0, dated 17 Jun 2014 β yes she's vintage, she's a classic, and she still eats. mwah ππΊ
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms