wechatpy 设置代理

wechatpy 设置代理访问微信接口

 

实例代码

corpid = config.weChatConfig["corpid"]
secret = config.weChatConfig["secret"]
qyclient = WeChatClient(corpid, secret)
domain = config.domain

url = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ID&corpsecret=SECRET"

proxy_host = "10.4.125.40"
proxy_port = "8080"
proxy_auth = "username:password"
proxies = {
    "http": "http://{}@{}:{}/".format(proxy_auth, proxy_host, proxy_port),
    "https": "http://{}@{}:{}/".format(proxy_auth, proxy_host, proxy_port)
}

if ENV_PROFILE == "PRO":
    qyclient._http.proxies.update(proxies)

 

 

 

posted @ 2020-02-27 14:27  汪丛兴  阅读(444)  评论(0编辑  收藏  举报