In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the Wechat public platform development of how to achieve Web proxy function, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Since the Senparc.Weixin.dll v4.5.7 release, we have provided the Web proxy function so that applications in restricted Lans can call the interface smoothly.
All the relevant changes are in Senparc.Weixin/Utilities/HttpUtility/RequestUtility.cs:
# region agent private static WebProxy _ webproxy = null; / set Web agent / public static void SetHttpProxy (string host, string port, string username, string password) {ICredentials cred; cred = new NetworkCredential (username, password) If (! string.IsNullOrEmpty (host)) {_ webproxy = new WebProxy (host + ":" + port? "80", true, null, cred);}} / clear Web agent status / public static void RemoveHttpProxy () {_ webproxy = null } # endregion
The method of use is as follows:
1. Set the proxy message before calling the API (global only once):
/ / set RequestUtility.SetHttpProxy ("http://192.168.1.130","8088","username","pwd");"
2. Call the interface method normally, and this proxy parameter will be applied automatically.
When you need to clear the agent state, execute the RemoveHttpProxy () method globally:
/ clear RequestUtility.RemoveHttpProxy (); Thank you for reading this article carefully. I hope the article "how to achieve Web proxy function in the development of Wechat public platform" shared by the editor will be helpful to you. At the same time, I hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.