JeffreySu / WeiXinMPSDK

微信全平台 .NET SDK, Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 8.0。已支持微信公众号、小程序、小游戏、微信支付、企业微信/企业号、开放平台、JSSDK、微信周边等全平台。 WeChat SDK for C#.
https://weixin.senparc.com
Apache License 2.0
8.48k stars 4.36k forks source link

HTTP代理问题, #183

Closed kingreatwill closed 8 years ago

kingreatwill commented 8 years ago

你好,能否增加代理功能?公司使用代理才能访问外网,作为最强大weixinSDK建议加上此功能

kingreatwill commented 8 years ago

不好意思,里面有代理~~

kingreatwill commented 8 years ago

///

    /// 从Url下载
    /// </summary>

    /// <param name="url"></param>
    /// <param name="stream"></param>
    public static void Download(string url, Stream stream)
    {
        //ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
        //ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);  
        WebClient wc = new WebClient();
        var data = wc.DownloadData(url);
        foreach (var b in data)
        {
            stream.WriteByte(b);
        }
    }

这个没有

JeffreySu commented 8 years ago

代理已经有了,可能有部分地方没有覆盖到,欢迎继续反馈,感谢!