Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Commit

Permalink
Merge pull request #27 from azendoo/master
Browse files Browse the repository at this point in the history
Adding support for Proxy options
  • Loading branch information
Edward Muller committed Mar 18, 2013
2 parents 29d7fbf + cbc04c1 commit 4770654
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/logglier/client/http/sync.rb
Expand Up @@ -32,6 +32,10 @@ def initialize(input_uri, opts={})
@open_timeout = opts[:open_timeout] || 5
@failsafe = opts[:failsafe] || $stderr
@format = opts[:format] ? opts[:format].to_sym : nil
@proxy_addr = opts[:proxy_addr]
@proxy_port = opts[:proxy_port]
@proxy_user = opts[:proxy_user]
@proxy_password = opts[:proxy_password]
@headers = {}
if @format == :json
@headers['Content-Type'] = 'application/json'
Expand Down Expand Up @@ -68,7 +72,8 @@ def deliver(message)
private

def connect!
@http = Net::HTTP.new(@input_uri.host, @input_uri.port)
@http_class = Net::HTTP::Proxy(@proxy_addr, @proxy_port, @proxy_user, @proxy_user)
@http = @http_class.new(@input_uri.host, @input_uri.port)

if @input_uri.scheme == 'https'
@http.use_ssl = true
Expand Down

0 comments on commit 4770654

Please sign in to comment.