Method: Lono::Api::Proxy#http

Defined in:
lib/lono/api/proxy.rb

#http(url) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/lono/api/proxy.rb', line 17

def http(url)
  uri = URI(url)
  http = Net::HTTP.new(uri.host, uri.port)
  http.open_timeout = http.read_timeout = 30
  http.use_ssl = true if uri.scheme == 'https'
  http
end