[Rubygems-developers] Gem problem behind Proxy with authorization.

Anatol Pomozov anatol.pomozov at gmail.com
Sat Dec 10 08:48:20 EST 2005

Hi. I am again picking up question about Gem that working behind proxy with
Problem related to
Seems that is most requestable bug in Gem project.

I am sitting behind passworded proxy and only this problem give me no rest.
After installing DamageControl that requires
more then 10 gems I decided to investigate this problem by myself.

First of all Open-uri lib does not support http_proxy with login/password
encoded in URL.
So my EnvVariable HTTP_PROXY=http://lgoin:passwd@www.proxy.com:8080/ does
not work.
I patched open-uri to solve this problem. To be honest I patch open-uri lib
from RubyCVS version that will be in Ruby 1.8.4 version.

Here you can find patch and here full *.rb version(
http://pomozov.info/downloads/gems/open-uri.patch and
http://pomozov.info/downloads/gems/open-uri.rb). I have replaced following
file "C:\Program Files\ruby\lib\ruby\site_ruby\1.8\rubygems\open-uri.rb"
with patched version

And following code(insied patched open-uri)
    io.status = [resp.code, resp.message]
    p io.status
give us
    ["200", "OK"]

So now socket connection seems ok.

Also I have tried to dump data that comes from socket (
http://pomozov.info/downloads/gems/dump.Z) and I found that it is absolutely
the same files as http://gems.rubyforge.org/yaml.Z
So Gem *could download* index file. Proxy wall passed!!!! I feel solution is
somewhere close to me.
But I try to run gem and I get error

C:\Documents and Settings\anatol>gem list -r --backtrace

Updating Gem source index for: http://gems.rubyforge.org
ERROR:  HTTP Response 407

No stacktrace, no error. What I am doing wrong?? How could I get more info?
How to figure place where error occurred.
Please help me I want to solve this problem very much. I want to use Gems.
anatol (http://pomozov.info)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rubygems-developers/attachments/20051210/4439cd42/attachment.htm

More information about the Rubygems-developers mailing list