Esempio n. 1
0
        public async Task <ScanResults> RunAsync(ScanRequest request, CancellationToken cancellationToken)
        {
            // Important, as the HttpClient can not be edited after initializing
            _httpClientWrapper.RegisterClient(request.Proxy, false);
            var results = new ScanResults(request.Host);

            var tasks = request.Targets.Select(target => ScanTarget(request, cancellationToken, target, results))
                        .ToList();

            await Task.WhenAll(tasks.ToArray());

            return(results);
        }