Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (HttpClientHandler handler = new HttpClientHandler())
- {
- handler.Proxy = new WebProxy(proxy.IP);
- handler.UseProxy = true;
- using (HttpClient client = new HttpClient())
- {
- client.Timeout = TimeSpan.FromMilliseconds(Timeout);
- Stopwatch sw = new Stopwatch();
- sw.Start();
- string responseString = client.GetStringAsync(ProxyJudgeUri).Result;
- sw.Stop();
- proxy.Timeout = sw.ElapsedMilliseconds;
Advertisement
Add Comment
Please, Sign In to add comment