Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm having a good deal of trouble getting curl or wget to download files from FTP servers through an FTP proxy. I have setup GUI FTP programs to work...

gFTP works with these settings:

enter image description here

I get output like below when just using curl/wget with the ftp_proxy variable set to the proxy hostname:

# curl -v ftp://ftp.astron.com/pub/file/file-5.05.tar.gz
* About to connect() to proxy blah port 21 (#0)
*   Trying blah... connected
* Connected to blah (blah) port 21 (#0)
> GET ftp://ftp.astron.com/pub/file/file-5.05.tar.gz HTTP/1.1
> User-Agent: curl/7.19.0 (x86_64-suse-linux-gnu) libcurl/7.19.0 OpenSSL/0.9.8h zlib/1.2.3 libidn/1.10
> Host: ftp.astron.com:21
> Pragma: no-cache
> Accept: */*
> Proxy-Connection: Keep-Alive
>
220-
220-Enter an Internet ftp address at the Name prompt.
220 Type help for usage information.
500 Syntax error, command unrecognized.
500 Syntax error, command unrecognized.
500 Syntax error, command unrecognized.

Is there some way I can configure the shell environment and/or curl/wget with the same settings as gFTP for passing through an FTP proxy?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The problem here seems to be the type of proxy used.

The proxy you are using is an FTP proxy. Wget`and Curl both use HTTP proxies.

share|improve this answer
1  
Both curl and wget support FTP proxies... wget: gnu.org/software/wget/manual/wget.html#Proxies ... curl: curl.haxx.se/docs/manual.html –  entropo Mar 30 '11 at 21:11
    
Ah no - they support proxies for FTP transfers using HTTP proxies - not FTP native proxies. The protocols are different. The "GET blah.blah HTTP/1.1" in your debug output is a dead giveaway - that's an HTTP proxy request that is being generated. –  Majenko Mar 30 '11 at 21:15
    
Hmm, okay. Are there any command line tools which DO support native FTP proxying? –  entropo Mar 30 '11 at 21:39
1  
You may not need them - the way the FTP proxy works you may be able to slip the details into the URL... f t p://ftp@remote.host.com@ftp.proxy.com/path/to/file without any proxy set might possibly work. It's worth a try anyway –  Majenko Mar 30 '11 at 21:40
1  
If that doesn't work, try missing out the ftp@ or maybe changing the first @ to %40 –  Majenko Mar 30 '11 at 21:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.