Proxy

An extensible embedded proxy client to multiple hosts.

Usage

Source

Proxy()

The default implementation provides load balancing based on active connections. It does not provide error handling or retrying.

Parameters

*urls: str

base urls for requests

**kwargs
same options as Client

Methods

Name Description
choice() Return chosen url according to priority.
priority() Return comparable priority for url.
request() Send request with relative or absolute path and return response.

choice()

Return chosen url according to priority.

Usage

Source

choice(method)
Parameters
method: str
placeholder for extensions which distinguish read/write requests

priority()

Return comparable priority for url.

Usage

Source

priority(url)

Minimizes errors, failures (500s), and active connections. None may be used to eliminate from consideration.


request()

Send request with relative or absolute path and return response.

Usage

Source

request(method, path, **kwargs)