quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

CURLOPT_PROXY_TRANSFER_MODE.md (1628B)


      1 ---
      2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
      3 SPDX-License-Identifier: curl
      4 Title: CURLOPT_PROXY_TRANSFER_MODE
      5 Section: 3
      6 Source: libcurl
      7 See-also:
      8   - CURLOPT_CRLF (3)
      9   - CURLOPT_HTTPPROXYTUNNEL (3)
     10   - CURLOPT_PROXY (3)
     11   - CURLOPT_TRANSFERTEXT (3)
     12 Protocol:
     13     - All
     14 Added-in: 7.18.0
     15 ---
     16 
     17 # NAME
     18 
     19 CURLOPT_PROXY_TRANSFER_MODE - append FTP transfer mode to URL for proxy
     20 
     21 # SYNOPSIS
     22 
     23 ~~~c
     24 #include <curl/curl.h>
     25 
     26 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_TRANSFER_MODE,
     27                           long enabled);
     28 ~~~
     29 
     30 # DESCRIPTION
     31 
     32 Pass a long. If the value is set to 1 (one), it tells libcurl to set the
     33 transfer mode (binary or ASCII) for FTP transfers done via an HTTP proxy, by
     34 appending ;type=a or ;type=i to the URL. Without this setting, or it being set
     35 to 0 (zero, the default), CURLOPT_TRANSFERTEXT(3) has no effect when
     36 doing FTP via a proxy. Beware that not all proxies support this feature.
     37 
     38 # DEFAULT
     39 
     40 0, disabled
     41 
     42 # %PROTOCOLS%
     43 
     44 # EXAMPLE
     45 
     46 ~~~c
     47 int main(void)
     48 {
     49   CURL *curl = curl_easy_init();
     50   if(curl) {
     51     CURLcode res;
     52     curl_easy_setopt(curl, CURLOPT_URL,
     53                      "ftp://example.com/old-server/file.txt");
     54     curl_easy_setopt(curl, CURLOPT_PROXY, "http://localhost:80");
     55     curl_easy_setopt(curl, CURLOPT_PROXY_TRANSFER_MODE, 1L);
     56     curl_easy_setopt(curl, CURLOPT_TRANSFERTEXT, 1L);
     57     res = curl_easy_perform(curl);
     58     curl_easy_cleanup(curl);
     59   }
     60 }
     61 ~~~
     62 
     63 # %AVAILABILITY%
     64 
     65 # RETURN VALUE
     66 
     67 curl_easy_setopt(3) returns a CURLcode indicating success or error.
     68 
     69 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
     70 libcurl-errors(3).