cURL / Mailing Lists / curl-library / Single Mail

curl-library

Problem with CURLOPT_PORT

From: <orobin_at_histor.fr>
Date: Mon, 18 Apr 2005 15:57:48 +0200 (CEST)

Hi everybdy,

I would like to specify a particular port (not 21) to connect to a ftp
server.
I can do it in the url (ftp://200.0.0.52:22) but I would like to use the
CURLOPT_PORT option.
Unfortunately, this one has no effect: I set CURLOPT_PORT to 22 but my
client always connects to the server on the port 21.

Here is the code :

CURL* curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, "ftp://200.0.0.52");
curl_easy_setopt(curl, CURLOPT_PORT, 22);
curl_easy_setopt(curl, CURLOPT_USERPWD, "xxx:yyy");
curl_easy_perform(curl);

Thank you if you can explain me the behavior of CURLOPT_PORT.

Olivier.
Received on 2005-04-18