Permalink
Browse files

support proxy.

  • Loading branch information...
1 parent ff70992 commit 92f57ad15bed843dfac44f387a892f31b5188fe8 @mattn mattn committed Oct 18, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 plugins/gist_tag.rb
View
@@ -71,7 +71,13 @@ def get_cache_file_for(gist, file)
def get_gist_from_web(gist, file)
gist_url = get_gist_url_for gist, file
raw_uri = URI.parse gist_url
- https = Net::HTTP.new raw_uri.host, raw_uri.port
+ proxy = ENV['http_proxy']
+ if proxy
+ proxy_uri = URI.parse(proxy)
+ https = Net::HTTP::Proxy(proxy_uri.host, proxy_uri.port).new raw_uri.host, raw_uri.port
+ else
+ https = Net::HTTP.new raw_uri.host, raw_uri.port
+ end
https.use_ssl = true
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new raw_uri.request_uri

0 comments on commit 92f57ad

Please sign in to comment.