Module: Async::HTTP::Proxy::Client

Included in:
Client
Defined in:
lib/async/http/proxy.rb

Instance Method Summary collapse

Instance Method Details

#proxied_client(endpoint, headers = []) ⇒ Object

Create a client that will proxy requests through the current client.



37
38
39
40
41
# File 'lib/async/http/proxy.rb', line 37

def proxied_client(endpoint, headers = [])
  proxy = self.proxy(endpoint, headers)
  
  return self.class.new(proxy.wrap_endpoint(endpoint))
end

#proxied_endpoint(endpoint, headers = []) ⇒ Object



43
44
45
46
47
# File 'lib/async/http/proxy.rb', line 43

def proxied_endpoint(endpoint, headers = [])
  proxy = self.proxy(endpoint, headers)
  
  return proxy.wrap_endpoint(endpoint)
end

#proxy(endpoint, headers = []) ⇒ Object



32
33
34
# File 'lib/async/http/proxy.rb', line 32

def proxy(endpoint, headers = [])
  Proxy.new(self, endpoint.authority(false), headers)
end