Skip to content

Commit

Permalink
Allow proxy authentication with net/http
Browse files Browse the repository at this point in the history
  • Loading branch information
ebeigarts committed Dec 9, 2011
1 parent 197b5bb commit 9b0eb6c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/httpi/adapter/net_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ def delete(request)
attr_writer :client

def new_client(request)
proxy = request.proxy || URI("")
Net::HTTP::Proxy(proxy.host, proxy.port).new request.url.host, request.url.port
proxy_url = request.proxy || URI("")
proxy = Net::HTTP::Proxy(proxy_url.host, proxy_url.port, proxy_url.user, proxy_url.password)
proxy.new request.url.host, request.url.port
end

def do_request(type, request)
Expand Down

0 comments on commit 9b0eb6c

Please sign in to comment.