splunk_rest_client.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:TA-SyncKVStore 作者: georgestarcher 项目源码 文件源码
def _get_proxy_info(context):
    if not context.get('proxy_hostname') or not context.get('proxy_port'):
        return None

    user_pass = ''
    if context.get('proxy_username') and context.get('proxy_password'):
        username = urllib2.quote(context['proxy_username'], safe='')
        password = urllib2.quote(context['proxy_password'], safe='')
        user_pass = '{user}:{password}@'.format(
            user=username, password=password)

    proxy = 'http://{user_pass}{host}:{port}'.format(
        user_pass=user_pass, host=context['proxy_hostname'],
        port=context['proxy_port'])
    proxies = {
        'http': proxy,
        'https': proxy,
    }
    return proxies
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号