cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Libcurl uses HTTP GET command while using ftp protocol via proxy server

From: Ramprasad N <ramprasad85_at_gmail.com>
Date: Fri, 22 May 2015 05:38:38 +0530

Hi,
This seems to be happening even after setting CURLOPT_HTTPPROXYTUNNEL to 1
libcurl is tunneling through the proxy (we can see the CONNECT request),
but after the tunneling has been created, curl is doing HTTP GET instead of
FTP commands. right?

Thanks

Date: Tue, 19 May 2015 23:30:04 +0200 (CEST)
From: Daniel Stenberg <daniel_at_haxx.se>
To: Munirathinam Yuvaraj <rajayuvaraja_at_yahoo.com>, libcurl development
        <curl-library_at_cool.haxx.se>
Subject: Re: Libcurl uses HTTP GET command while using ftp protocol
        via proxy server
Message-ID: <alpine.DEB.2.11.1505192327250.10925_at_tvnag.unkk.fr>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

On Tue, 19 May 2015, Munirathinam Yuvaraj via curl-library wrote:

> Hi I tried to connect a ftp server using libcurl via a proxy server.In my
> code I had made settings for ftp protocol, it was able to connect with the
> server but unable to list directories and files present on the Server.
When
> I scrutinzed the output available on the command window, found GET /
> HTTP/1.1

That's because you asked to use a *HTTP* proxy, which means curl speaks HTTP
over it.

You can sometimes as the proxy to get a connection tunneled through, which
you
then can can use to speak FTP with a proxy. See CURLOPT_HTTPPROXYTUNNEL[1]
for
that.

[1] = http://curl.haxx.se/libcurl/c/CURLOPT_HTTPPROXYTUNNEL.html
On Wed, May 20, 2015 at 12:19 AM, <curl-library-request_at_cool.haxx.se> wrote:

> Date: Tue, 19 May 2015 18:41:24 +0000 (UTC)
> From: Munirathinam Yuvaraj <rajayuvaraja_at_yahoo.com>
> To: "curl-library_at_cool.haxx.se" <curl-library_at_cool.haxx.se>
> Subject: Libcurl uses HTTP GET command while using ftp protocol via
> proxy server
> Message-ID:
> <1928515362.2645577.1432060884434.JavaMail.yahoo_at_mail.yahoo.com>
> Content-Type: text/plain; charset="utf-8"
>
> HiI tried to connect a ftp server using libcurl via a proxy server.In my
> code I had made settings for ftp protocol, it was able to connect with the
> server but unable to list directories and files present on the Server.
> When I scrutinzed the output available on the command window, found GET /
> HTTP/1.1Usage of HTTP command will result in modifying my program code at
> many locations, for the time being this is not feasible for me.I do not
> want to use any HTTP command, is there any way to force libcurl to use only
> ftp commands?Is there any curl_easy_setopt options that can be helpful to
> me?
> Below I have pasted the output information that was available on the
> command window.
>
> Trying 10.224.24.250... connected* Establish HTTP proxy tunnel to
> *****.com:21* Server auth using Basic with user '****'> CONNECT ****.com:21
> HTTP/1.1> Host: ****.com:21> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu)
> libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
>
> > Proxy-Connection: Keep-Alive> < HTTP/1.1 200 OK< Server: FreeProxy/4.50<
> Date: Tue, 19 May 2015 18:00:12 GMT< Content-Type:
> application/octet-stream< * Proxy replied OK to CONNECT request* Server
> auth using Basic with user 'matrix'> GET / HTTP/1.1> Authorization: Basic
> bWF0cml4Om1hdHJpeA==> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu)
> libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3> Host:
> ****.com:21> Accept: */*> 220-FileZilla Server version 0.9.43
> beta220-written by Tim Kosse (tim.kosse_at_filezilla-project.org)220 Please
> visit http://sourceforge.net/projects/filezilla/* Connection #0 to host
> 10.224.24.250 left intact* Closing connection #0
> Thanks & RegardsYuvaraj
>
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-05-22