[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

open-uri.rb causing proxy problems?

Adriano Nagel

2/1/2007 5:04:00 PM

Hi,

I'm behind a squid proxy trying to install gems, to no avail (the
http_proxy env var is correctly set):

Error fetching remote gem cache: 407 Proxy Authentication Required

I took a look at gem's remote_fetcher.rb, which in turn uses open-uri
as a wrapper to net/http:

connection_options = {
"User-Agent" => "RubyGems/#{Gem::RubyGemsVersion}",
:proxy => @proxy_uri,
}
open(uri, connection_options, &block)

Examining open-uri.rb, I changed the line

klass = Net::HTTP::Proxy(proxy.host, proxy.port)

to

klass = Net::HTTP::Proxy(proxy.host, proxy.port, proxy.user,
proxy.password)

and it seems to work (probably user and proxy should be URI
unescaped).

Any thoughts?

Thanks

--
Adriano