Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nseo/2627811 to your computer and use it in GitHub Desktop.
Save nseo/2627811 to your computer and use it in GitHub Desktop.
Bundler with HTTP_PROXY/NO_PROXY
--- lib/bundler/vendor/net/http/persistent.rb.orig 2012-05-07 06:19:19.629713946 -0700
+++ lib/bundler/vendor/net/http/persistent.rb 2012-05-07 06:38:32.601764475 -0700
@@ -2,6 +2,7 @@
require 'net/http/faster'
require 'uri'
require 'cgi' # for escaping
+require 'http_configuration'
##
# Persistent connections for Net::HTTP
@@ -155,6 +156,9 @@
def initialize name = nil, proxy = nil
@name = name
+ if no_proxy = ENV['NO_PROXY'] || ENV['no_proxy']
+ Net::HTTP::Configuration.set_global :no_proxy => no_proxy
+ end
@proxy_uri = case proxy
when :ENV then proxy_from_env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment