From: Dominique Brezinski Date: 2005-09-29T03:13:08+09:00 Subject: Re: gems is a language change, not a pkging system (Re: Require Namepaces and RubyGems' effect on LoadPath problem) On 9/28/05, Austin Ziegler wrote: > Just a simple question -- how would one authenticate with such a > firewall with Ruby in general? This is a really bad piece of code, but it shows using a standard lib to use a username/password authenticated HTTP proxy for a get. #! /usr/bin/ruby require 'net/http' site, uri = ARGV[0].split(/\//, 2) puts "Site: #{site} URI: /#{uri}" Net::HTTP::Proxy('192.168.1.1', 80, ARGV[1], ARGV[2]).start(site) do |http| http.read_timeout=(600) response = http.get("/#{uri}") File::open(uri.split(/\//)[-1], 'w') {|f| f.write(response.body) } end