From: "Kristian Sørensen" Date: 2003-11-17T10:26:29+09:00 Subject: Re: Access ftp-server through proxy Clifford Heath wrote: > Kristian S�rensen wrote: > >> Okay, that's sounds easy, but I can't get it to work. Can you complete >> a ftp-download example? > > > I don't know if it's possible with Ruby 1.6. Your example doesn't work > because the "start" method expects a DNS-resolvable name, but you > gave it "ftp://anonymous:anonymous@ftp.sunsite.dk". > > I don't recall seeing this in 1.6, but 1.8 has Net::HTTP.Proxy: > > #! /usr/bin/env ruby > require 'net/http' > > Net::HTTP::Proxy('webproxy.local', 3128).start('ftp.netscape.com') { |http| > response, data = http.get('/') > $stdout.write(data) > } > > Works a treat here. Hi again! As I wrote earlier, it seems to work nicely. However the reason for this, is that a webserver is also providing an interface to ftp.netscape.com. The request created by Ruby is an http request on port 80, not a ftp request. Fortunately the all-over solution just poped into my head: use wget... `wget --passive-ftp #{server}:#{pathAndFile}` Cheers, KS.