public void Init() { var option = new DotNettyClientOptions() { Proxy = new WebProxy(TestServerConstant.TestHost, TestServerConstant.ProxyPort) }; var handler = new HttpDotNettyClientHandler(option); _httpClient = new HttpClient(handler); }
public void Init() { var option = new DotNettyClientOptions() { RemoteCertificateValidationCallback = (s, s1, s2, s3) => TestServerConstant.CertThumbprint.Equals(s2.ChainElements[0].Certificate.Thumbprint, StringComparison.OrdinalIgnoreCase), }; var handler = new HttpDotNettyClientHandler(option); _httpClient = new HttpClient(handler); }
public virtual void Init() { var option = new DotNettyClientOptions() { ConnectionLimit = ConnectionLimit, Proxy = new WebProxy(TestServerConstant.TestHost, TestServerConstant.ProxyPort), ResourcesTimeout = TimeSpan.FromSeconds(TimecouSeconds), ResourcesCheckInterval = TimeSpan.FromDays(1), }; _executor = new DotNettyHttpRequestExecutor(option); }
public void Init() { var option = new DotNettyClientOptions() { Proxy = new WebProxy(TestServerConstant.TestHost, TestServerConstant.AuthProxyPort) { Credentials = new NetworkCredential(TestServerConstant.ProxyUserName, TestServerConstant.ProxyPassword) } }; var handler = new HttpDotNettyClientHandler(option); _httpClient = new HttpClient(handler); }
public void Init() { var option = new DotNettyClientOptions() { RemoteCertificateValidationCallback = (s, s1, s2, s3) => TestServerConstant.CertThumbprint.Equals(s2.ChainElements[0].Certificate.Thumbprint, StringComparison.OrdinalIgnoreCase), Proxy = new WebProxy(TestServerConstant.TestHost, TestServerConstant.AuthProxyPort) { Credentials = new NetworkCredential(TestServerConstant.ProxyUserName, TestServerConstant.ProxyPassword) } }; var handler = new HttpDotNettyClientHandler(option); _httpClient = new HttpClient(handler); }
public async Task MultiHttpDotNettyClientHandler() { var option = new DotNettyClientOptions() { ConnectionLimit = 25, }; var client = new HttpClient(new HttpDotNettyClientHandler(option)); var tasks = Enumerable.Range(0, RequestCount).Select(async m => { var html = await client.GetStringAsync(Url).ConfigureAwait(false); }); await Task.WhenAll(tasks).ConfigureAwait(false); }