Skip to content

Commit

Permalink
Merge pull request jruby#195 from dekz/master
Browse files Browse the repository at this point in the history
Net::HTTP ignores HTTP_PROXY and http.proxyHost
  • Loading branch information
headius committed Aug 28, 2012
2 parents c3be423 + 1965fa8 commit e283bc9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ruby/1.9/net/http.rb
Expand Up @@ -877,6 +877,10 @@ def do_finish
# If you want to use a proxy, you must set it explicitly.
#
def HTTP.Proxy(p_addr, p_port = nil, p_user = nil, p_pass = nil)
j_addr = java.lang.System.get_property('http.proxyHost')
j_port = java.lang.System.get_property('http.proxyPort')
p_addr = p_addr || j_addr
p_port = p_port || j_port
return self unless p_addr
delta = ProxyDelta
proxyclass = Class.new(self)
Expand Down

0 comments on commit e283bc9

Please sign in to comment.