Class: Sibit::HttpProxy
- Inherits:
-
Object
- Object
- Sibit::HttpProxy
- Defined in:
- lib/sibit/http.rb
Overview
This HTTP client with proxy.
Instance Method Summary collapse
- #client(uri) ⇒ Object
-
#initialize(addr) ⇒ HttpProxy
constructor
A new instance of HttpProxy.
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 |