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.



43
44
45
# File 'lib/sibit/http.rb', line 43

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

Instance Method Details

#client(uri) ⇒ Object



47
48
49
50
51
52
# File 'lib/sibit/http.rb', line 47

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