CURLOPT_PROXY_TRANSFER_MODE(3)

CURLOPT_PROXY_TRANSFER_MODE πŸ’…

okay so bestie, this is the CURLOPT_PROXY_TRANSFER_MODE page from the Library Functions Manual β€” manual name folded in right here like a little name tag 🫢. She's all about appending the FTP transfer mode to a URL for a proxy, and yes, she's a little niche, but that's her main character energy.


🌸 NAME 🌸

CURLOPT_PROXY_TRANSFER_MODE β€” append FTP transfer mode to URL for proxy. literally the whole assignment, and she understood it πŸ’–.

✨ SYNOPSIS ✨

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_TRANSFER_MODE,
                          long enabled);

πŸ’– DESCRIPTION πŸ’–

You pass a long. If the value is set to 1 (one), it tells libcurl to set the transfer mode (binary or ASCII) for FTP transfers done via an HTTP proxy, by appending ;type=a or ;type=i to the URL.

Without this setting, or if it's set to 0 (zero, the default), CURLOPT_TRANSFERTEXT(3) has no effect when doing FTP via a proxy. no cap, that's just the tea.

⚠️ Beware that not all proxies support this feature. like, do a vibe check on your proxy before you count on it, bestie πŸ’€

πŸŽ€ DEFAULT πŸŽ€

0, disabled. she starts off asleep, periodt.

🌈 PROTOCOLS 🌈

This functionality affects all supported protocols β€” all of them, bestie ✨.

πŸ“ EXAMPLE πŸ“

look at her go:

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    CURLcode result;
    curl_easy_setopt(curl, CURLOPT_URL,
                     "ftp://example.com/old-server/file.txt");
    curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:80");
    curl_easy_setopt(curl, CURLOPT_PROXY_TRANSFER_MODE, 1L);
    curl_easy_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
    result = curl_easy_perform(curl);
    curl_easy_cleanup(curl);
  }
}

πŸ¦‹ AVAILABILITY πŸ¦‹

Added in curl 7.18.0. a whole vintage icon, honestly.

πŸ’œ 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).

πŸ‘‘ SEE ALSO πŸ‘‘


mwah πŸ’‹ signing off fr fr: source/version libcurl, dated 2026-10-12, footer tag CURLOPT_PR...ANSFER_MODE(3). stay slay, bestie 🫢

πŸ“¦ where this page comes from