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)

原文地址:https://www.cnblogs.com/wangcongxing/p/12371996.html