Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Added support for proxy environment variables (http_proxy and https_proxy) #6

wants to merge 2 commits into from

1 participant


Enable support for proxyfied environments to use AWS gem:

export https_proxy=""

Initiate request via AWS gem and you should see:

I, [2011-06-03T13:58:01.873547 #30152] INFO -- : New Aws::Ec2 using per_thread-connection mode
I, [2011-06-03T13:58:01.874218 #30152] INFO -- : Opening new HTTPS connection to
I, [2011-06-03T13:58:01.874404 #30152] INFO -- : Using proxy for connection

PS: Sorry for a new pull request, I had a typo in https ;-)


any chance to pull this and bump gem version? :)




ping #2 ? :-)


this typo was resolved in the next commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 0 deletions.
  1. +14 −0 lib/right_http_connection.rb
14 lib/right_http_connection.rb
@@ -278,6 +278,20 @@ def start(request_params)"Opening new #{@protocol.upcase} connection to #@server:#@port")
@http =, @port)
+ # Support HTTP and HTTPS proxies
+ if @protocol == "https" && ENV['https_proxy']
+ proxy_host, proxy_port = ENV['https_proxy'].gsub(/^http(s?):\/\//, '').split(':')
+ @http = Net::HTTP::Proxy(proxy_host, proxy_port).new(@server, @port)
+"Using #{proxy_host}:#{proxy_port} proxy for connection")
+ end
+ if @protocol == "http" && ENV['http_proxy']
+ proxy_host, proxy_port = ENV['http_proxy'].gsub(/^http(s?):\/\//, '').split(':')
+ @http = Net::HTTP::Proxy(proxy_host, proxy_port).new(@server, @port)
+"Using #{proxy_host}:#{proxy_port} proxy for connection")
+ end
@http.open_timeout = @params[:http_connection_open_timeout]
@http.read_timeout = @params[:http_connection_read_timeout]
Something went wrong with that request. Please try again.