[ftputil] FTP Through HTTP Proxy

Stefan Schwarzer sschwarzer at sschwarzer.net
Tue Mar 27 18:25:51 CEST 2007


Hi Alexander,

On 2007-03-27 16:33, Alexander Michael wrote:
> On 3/26/07, Stefan Schwarzer <sschwarzer at sschwarzer.net> wrote:
>> The HTTP proxy and FTP proxy are independent [of] each other (with
>> the exception that the provider may use the same host for both
>> proxies, but also then you can treat the proxies as independent).
>> So if you use the ftp:// protocol, the HTTP proxy shouldn't
>> matter at all.
> 
> Actually, that's just it, they're not independent. With a little more
> digging with Google, I've discovered that this mechanism for accessing
> a remote FTP site over an HTTP proxy is called "FTP-over-HTTP" or
> sometimes simply HFTP. Apparently, RFC 2616 (HTTP/1.1) accommodates
> this mechanism for proxies and gateways with the Host header field.
> When typing the "ftp" URL in Firefox configured to use a proxy,
> Firefox actually sends the request via HTTP to the HTTP proxy server
> and the proxy server acts as the FTP client with the remote FTP
> server. The HTTP proxy then responds to the web browser via HTTP with
> contents of the FTP URL.

Funny, I didn't think of something like that. There's always
something to learn. :)

>> To my surprise, the environment variable is usually ftp_proxy
>> (lowercase) though generally environment variables are all
>> uppercase. Please try the lowercase va
> 
> Well, the curl man page listed it in upper case, but this is a moot
> point for my issue now that I understand it.

I've seen both spellings, but in recent years only(?) the lowercase
variant.

>> You shouldn't use complicated code unless you are sure you need
>> it. :-) I suggest to try the direct login first if you haven't
>> already done so.
> 
> Yeah. I was hoping to avoid this, but it has become clear to me what
> is going on, and that I am forced to go this circuitous route.

Good luck! :-) Would you mind to post the code you ended up with?

Stefan


More information about the ftputil mailing list