public void SetHttpProxyTest() { //设置 RequestUtility.SetHttpProxy("http://192.168.1.130", "8088", "username", "pwd"); //清除 RequestUtility.RemoveHttpProxy(); }
/// <summary> /// 添加作用于 SenparcHttpClient 的 WebProxy(需要在 AddSenparcGlobalServices 之前定义) /// </summary> /// <param name="serviceCollection"></param> /// <param name="host"></param> /// <param name="port"></param> /// <param name="username"></param> /// <param name="password"></param> /// <returns></returns> public static IServiceCollection AddSenparcHttpClientProxy(this IServiceCollection serviceCollection, string host, string port, string username, string password) { RequestUtility.SetHttpProxy(host, port, username, password); return(serviceCollection); }