# Gem problem behind proxy with authorization

**URL:** <https://www.ruby-forum.com/t/gem-problem-behind-proxy-with-authorization/49937>\
**Category:** Ruby\
**Created:** [December 10, 2005, 4:51pm UTC](https://www.ruby-forum.com/t/gem-problem-behind-proxy-with-authorization/49937 "2005-12-10T16:51:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anatol.pomozov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@anatol.pomozov](https://www.ruby-forum.com/u/anatol.pomozov)\
**Post date:** [December 10, 2005, 4:51pm UTC](https://www.ruby-forum.com/t/gem-problem-behind-proxy-with-authorization/49937/1 "2005-12-10T16:51:45Z")

</div>

Hi.

I am trying again to pick up question about Gem behind proxy with  
authorization.  
Problem related to  
[http://rubyforge.org/tracker/index.php?func=detail&aid=1289&group\_id=126&atid=575](http://rubyforge.org/tracker/index.php?func=detail&aid=1289&group_id=126&atid=575)

Seems that is most requestable bug in Gem project.

I am sitting behind proxy with authorization and only this problem gives  
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 it does not correctly parse my EnvVariable  
HTTP\_PROXY=[http://login:removed\_email\_address@domain.invalid:8080/](http://login:removed_email_address@domain.invalid:8080/)[http://lgoin:removed\_email\_address@domain.invalid:8080/](http://lgoin:removed_email_address@domain.invalid:8080/)  
.  
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.patchand](http://pomozov.info/downloads/gems/open-uri.patchand)  
[http://pomozov.info/downloads/gems/open-uri.rb](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 (see it here  
[http://pomozov.info/downloads/gems/dump.Z](http://pomozov.info/downloads/gems/dump.Z)  
) and I found that it is absolutely the same files as  
[http://gems.rubyforge.org/yaml.Z](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

\*\*\* REMOTE GEMS \*\*\*  
Updating Gem source index for: [http://gems.rubyforge.org](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.
