def getProxyFromConfig(cfg):
    """Get the proper proxy configuration variable from the supplied config
    object"""

    # Is there a conaryProxy defined?
    proxy = {}
    for k, v in cfg.conaryProxy.iteritems():
        # Munge http.* to conary.* to flag the transport layer that
        # we're using a Conary proxy
        v = 'conary' + v[4:]
        proxy[k] = v
    if proxy:
        return proxy
    return cfg.proxy