port-scanner
A simple, yet fast, async port scanner library for Rust. Built on async-std
Usage
A new Scanner only takes the timeout used for each port.
To run a port scan against localhost. This will return a vector of socket addresses that are listening on tcp:
use task;
use join_all;
use Scanner;
let ps = new;
let ftr = ps.run;
let my_addrs: = block_on;
println!;
It's easy to hit the open files limit on your system. To get around this, limit the scanner to running in batches of ports at a time:
let ftr = ps.run_batched;
let my_addrs: = block_on;
println!;
You can also schedule scans against multiple hosts. This will return a vector of vectors of socket addresses.
let my_ftr = ps.run_batched;
let dev1_ftr = ps.run_batched;
let dev2_ftr = ps.run_batched;
let all_ftrs = vec!;
let results: = block_on;
println!;