libcurl has two different ways to use an HTTP proxy for an FTP URL. Without tunneling, it can send an HTTP GET whose target is the FTP URL, asking the proxy to act as an FTP gateway.

When the service instead expects an HTTP CONNECT tunnel, enable RCurl’s corresponding option:

result <- RCurl::getURL(
  "ftp://ftp.example.net/pub/file.txt",
  .opts = list(
    proxy = "http://proxy.example.net:8080",
    httpproxytunnel = TRUE
  )
)

The proxy must permit connections to the FTP server’s required ports. A service limited to CONNECT on 443 can reject FTP’s control connection even when ordinary HTTPS browsing works.

FTP also uses a separate data connection for a listing or transfer. A successful control login does not prove that the negotiated data destination is permitted through the intermediary.

This mode carries FTP protocol through a tunnel; it does not make plain FTP encrypted. Use the file server’s supported secure protocol and the matching libcurl build when confidentiality is required. RCurl’s available protocols depend on the libcurl library it uses.

Erthyglow kevrennek