Class: HttpCrawler::Proxy::TestProxyApi::Client

Inherits:
Object
  • Object
show all
Includes:
Client, Client
Defined in:
lib/http_crawler/proxy/test_proxy_api/client.rb

Instance Attribute Summary

Attributes included from Client

#http, #uri

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Client

#auto_proxy=, for, for_module, #header, #init_header, #init_http, #initialize, #update_header, #update_proxy, #validation_page?

Class Method Details

.new(*args) ⇒ Object



12
13
14
# File 'lib/http_crawler/proxy/test_proxy_api/client.rb', line 12

def new(*args)
  @client ||= super(*args)
end

Instance Method Details

#get_proxy(parameter = {}) ⇒ Object



22
23
24
25
# File 'lib/http_crawler/proxy/test_proxy_api/client.rb', line 22

def get_proxy(parameter = {})
  r = http.get_fetch("/api/get_proxy")
  r.extend(HttpCrawler::Proxy::Laofu::Response::GetProxy)
end

#init_uriObject



17
18
19
# File 'lib/http_crawler/proxy/test_proxy_api/client.rb', line 17

def init_uri
  @uri = URI("http://127.0.0.1:1111/")
end