'Returns a dictionary of the headers to add to any request sent
through a proxy. This works with urllib3 magic to ensure that they are
correctly sent to the proxy, rather than in a tunnelled request if
CONNECT is being used.
This should not be called from user code, and is only exposed for use
when subclassing the
:class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.
:param proxies: The url of the proxy being used for this request.'

def proxy_headers(self, proxy):

    headers = {}
    (username, password) = get_auth_from_url(proxy)
    if (username and password):
        headers['Proxy-Authorization'] = _basic_auth_str(username, password)
    return headers
