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

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

Instance Method Summary collapse

Instance Method Details

#proxied_client(endpoint, headers = nil) ⇒ Object

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


48
49
50
51
52
# File 'lib/async/http/proxy.rb', line 48

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

#proxied_endpoint(endpoint, headers = nil) ⇒ Object


54
55
56
57
58
# File 'lib/async/http/proxy.rb', line 54

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

#proxy(endpoint, headers = nil) ⇒ Object


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

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