Index: /trunk/lib/http-access2.rb =================================================================== --- /trunk/lib/http-access2.rb (revision 127) +++ /trunk/lib/http-access2.rb (revision 128) @@ -109,4 +109,5 @@ def initialize(proxy = nil, agent_name = nil, from = nil) @proxy = nil # assigned later. + @proxy_auth = nil @no_proxy = nil @agent_name = agent_name @@ -184,4 +185,5 @@ raise ArgumentError.new("unsupported proxy `#{proxy}'") end + @proxy_auth = [@proxy.user, @proxy.password] end reset_all @@ -396,4 +398,8 @@ if extheader.is_a?(Hash) extheader = extheader.to_a + end + if @proxy_auth + proxy_cred = ["#{@proxy_auth[0]}:#{@proxy_auth[1]}"].pack('m').strip + extheader << ['Proxy-Authorization', "Basic " << proxy_cred] end cred = @basic_auth.get(uri)