Skip to content

Instantly share code, notes, and snippets.

@masaki
Created July 28, 2009 10:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masaki/157083 to your computer and use it in GitHub Desktop.
Save masaki/157083 to your computer and use it in GitHub Desktop.
RubyGems with HTTP_PROXY/NO_PROXY
--- rubygems/remote_fetcher.rb.orig 2009-07-28 19:01:30.000000000 +0900
+++ rubygems/remote_fetcher.rb 2009-07-28 19:05:47.000000000 +0900
@@ -4,6 +4,7 @@
require 'uri'
require 'rubygems'
+require 'http_configuration'
##
# RemoteFetcher handles the details of fetching gems and gem information from
@@ -57,6 +58,9 @@
def initialize(proxy = nil)
Socket.do_not_reverse_lookup = true
+ if no_proxy = ENV['NO_PROXY'] || ENV['no_proxy']
+ Net::HTTP::Configuration.set_global :no_proxy => no_proxy
+ end
@connections = {}
@requests = Hash.new 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment