Skip to content

Commit

Permalink
add HTTP proxy support for Excon
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Jul 26, 2013
1 parent 6b152a0 commit 2f1ff93
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ group :test do
gem 'coveralls', :require => false
gem 'em-http-request', '>= 1.0', :require => 'em-http'
gem 'em-synchrony', '>= 1.0', :require => ['em-synchrony', 'em-synchrony/em-http']
gem 'excon', '>= 0.16.1'
gem 'excon', '>= 0.25.3'
gem 'httpclient', '>= 2.2'
gem 'leftright', '>= 0.9', :require => false
gem 'minitest', '~> 5.0.5'
Expand Down
10 changes: 10 additions & 0 deletions lib/faraday/adapter/excon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ def call(env)
opts[:connect_timeout] = req[:open_timeout]
opts[:write_timeout] = req[:open_timeout]
end

if req[:proxy]
opts[:proxy] = {
:host => req[:proxy][:uri].host,
:port => req[:proxy][:uri].port,
:scheme => req[:proxy][:uri].scheme,
:user => req[:proxy][:user],
:password => req[:proxy][:password]
}
end
end

conn = ::Excon.new(env[:url].to_s, opts.merge(@connection_options))
Expand Down

0 comments on commit 2f1ff93

Please sign in to comment.