File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -28,17 +28,16 @@ static void Main(string[] args)
2828 /// </summary>
2929 static async void ScanProxy ( )
3030 {
31- var proxys = HttpProxy . Range ( IPAddress . Parse ( "221.122.13.1" ) , 8080 , 9999 ) . ToArray ( ) ;
3231 var target = new Uri ( "http://www.baidu.com" ) ;
32+ var proxys = HttpProxy . Range ( IPAddress . Parse ( "221.122.13.1" ) , 8080 , 9999 ) ;
33+
3334 var tasks = proxys . Select ( async p =>
3435 {
3536 Interlocked . Increment ( ref totalProxyCount ) ;
36- var state = await ProxyValidator . ValidateAsync ( p , target , TimeSpan . FromMilliseconds ( 500d ) ) ;
37- if ( state == HttpStatusCode . OK )
37+ if ( await ProxyValidator . ValidateAsync ( p , target , TimeSpan . FromMilliseconds ( 500d ) ) == HttpStatusCode . OK )
3838 {
3939 Console . WriteLine ( $ "扫描到代理服务:{ p . Host } :{ p . Port } ") ;
4040 }
41-
4241 var completed = Interlocked . Increment ( ref completedProxyCount ) ;
4342 Console . Title = $ "扫描进度:{ completed } /{ Interlocked . Read ( ref totalProxyCount ) } ";
4443 } ) ;
You can’t perform that action at this time.
0 commit comments