I can’t offer any real help; I can only say that RubyGems’ proxy
handling is completely outsourced to ‘open-uri’. If you can
demonstrate a simple app using just that, in which your particular
proxy works, it would help.
Why aren’t you using ‘net/http’?
This works for me.
require ‘net/http’
basic location info:
proxy_addr = ‘sg.proxy.avaya.com’
proxy_port = 8000
proxy_user = ‘assaph’
proxy_pass = ‘xxx’
site = “www.weatherzone.com.au”
uri = “/local/local.jsp?fcast=94768&obs=94768&img=radar&rad=003&fn=true”
I can’t offer any real help; I can only say that RubyGems’ proxy
handling is completely outsourced to ‘open-uri’. If you can
demonstrate a simple app using just that, in which your particular
proxy works, it would help.
Why aren’t you using ‘net/http’?
Probably because it doesn’t support ftp
AFAIK, open-uri is a wrapper round net/http anyway?
It just means you can replace the below with a simple
open(url) generally. It picks up your proxy from the environment
too, which is nice. Pity about the authentication, but that sounds
like a simple bug/missing feature.
···
This works for me.
require ‘net/http’
basic location info:
proxy_addr = ‘sg.proxy.avaya.com’
proxy_port = 8000
proxy_user = ‘assaph’
proxy_pass = ‘xxx’
site = “www.weatherzone.com.au”
uri = “/local/local.jsp?fcast=94768&obs=94768&img=radar&rad=003&fn=true”
I can’t offer any real help; I can only say that RubyGems’ proxy
handling is completely outsourced to ‘open-uri’. If you can
demonstrate a simple app using just that, in which your particular
proxy works, it would help.
Why aren’t you using ‘net/http’?
Probably because it doesn’t support ftp
AFAIK, open-uri is a wrapper round net/http anyway?
True and true. Also, George Marrows did the open-uri stuff, and one
of the best things about it is it greatly simplied our HTTP code.
It just means you can replace the below with a simple
open(url) generally. It picks up your proxy from the environment
too, which is nice. Pity about the authentication, but that sounds
like a simple bug/missing feature.
Unfortunately a quick glance through open-uri.rb didn’t yield an
obvious way to do proxy authentication. It looks like open-uri.rb
doesn’t use Net::HTTP::Proxy but rather just Net::HTTP.
I think it would definitely be worth looking into adding proxy
authentication support to open-uri.rb as opposed to hacking RubyGems
to work around it. Unfortunately, I don’t have a proxy that requires
authentication, so for me to do it would require that I setup Squid,
etc. Might take a while.
Assuming open-uri doesn’t support proxy authentication, would this be
something you (Adriano) would be interested in taking a shot at?
Also, George Marrows did the open-uri stuff, and one
of the best things about it is it greatly simplied our HTTP code.
Glancing back through the RubyGems CVS, it seems that the original
HTTP code didn’t support authenticating proxies. That’s not any help
to Adriano, but it is some consolation to me
I think it would definitely be worth looking into adding proxy
authentication support to open-uri.rb as opposed to hacking RubyGems
to work around it.
Completely agreed. I’m a little surprised it doesn’t just work already
… open-uri puts in a lot of effort to try to do the right thing by
the various PROXY environment variables.
Also, George Marrows did the open-uri stuff, and one
of the best things about it is it greatly simplied our HTTP code.
Glancing back through the RubyGems CVS, it seems that the original
HTTP code didn’t support authenticating proxies. That’s not any help
to Adriano, but it is some consolation to me
I never meant to imply that your code broke it.
I think it would definitely be worth looking into adding proxy
authentication support to open-uri.rb as opposed to hacking RubyGems
to work around it.
Completely agreed. I’m a little surprised it doesn’t just work already
… open-uri puts in a lot of effort to try to do the right thing by
the various PROXY environment variables.
I was surprised, too. Any open-uri hackers listening?
Completely agreed. I’m a little surprised it doesn’t just work already
… open-uri puts in a lot of effort to try to do the right thing by
the various PROXY environment variables.
open-uri doesn’t support authentication yet because I’m not sure how
to specify username/password properly.