Class: Sibit::HttpProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/sibit/http.rb

Overview

This HTTP client with proxy.

Instance Method Summary collapse

Constructor Details

#initialize(addr) ⇒ HttpProxy

Returns a new instance of HttpProxy.



26
27
28
# File 'lib/sibit/http.rb', line 26

def initialize(addr)
  @host, @port = addr.split(':')
end

Instance Method Details

#client(uri) ⇒ Object



30
31
32
33
34
35
# File 'lib/sibit/http.rb', line 30

def client(uri)
  http = Net::HTTP.new(uri.host, uri.port, @host, @port.to_i)
  http.use_ssl = true
  http.read_timeout = 240
  http
end