1CURLOPT_PROXYPORT(3) curl_easy_setopt options CURLOPT_PROXYPORT(3)
2
3
4
6 CURLOPT_PROXYPORT - port number the proxy listens on
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXYPORT, long port);
12
14 Pass a long with this option to set the proxy port to connect to unless
15 it is specified in the proxy string CURLOPT_PROXY(3) or uses 443 for
16 https proxies and 1080 for all others as default.
17
18 While this accepts a 'long', the port number is 16 bit so it can't be
19 larger than 65535.
20
22 0, not specified which makes it use the default port
23
25 All
26
28 CURL *curl = curl_easy_init();
29 if(curl) {
30 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
31 curl_easy_setopt(curl, CURLOPT_PROXY, "localhost");
32 curl_easy_setopt(curl, CURLOPT_PROXYPORT, 8080L);
33 ret = curl_easy_perform(curl);
34 curl_easy_cleanup(curl);
35 }
36
38 Always
39
41 Returns CURLE_OK
42
44 CURLOPT_PROXY(3), CURLOPT_PROXYTYPE(3),
45
46
47
48libcurl 7.76.1 November 04, 2020 CURLOPT_PROXYPORT(3)