'Return a ProxyInfo instance (or None) based on the scheme
and authority.'

def _get_proxy_info(self, scheme, authority):

    (hostname, port) = urllib.splitport(authority)
    proxy_info = self.proxy_info
    if callable(proxy_info):
        proxy_info = proxy_info(scheme)
    if (hasattr(proxy_info, 'applies_to') and (not proxy_info.applies_to(hostname))):
        proxy_info = None
    return proxy_info
