Add oports
as a dependency in the cargo.toml file of your project:
toml
[dependencies]
oports = "1.0.0"
If you have cargo-edit utility tool installed, use:
bash
$ cargo add oports
Check if the given port is open for a specified IP address.
```rust use oports; use std::net::IpAddr;
let localhost = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)); let isopen = oports::isport_open(localhost, 4040).await; ```
Retrieves a vec with open ports for a given vec of port numbers an IP addresses.
The default concurrency is 100
if the Option
resolves to a None
value.
```rust use oports; use std::net::IpAddr;
let localhost = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1));
let ports = (8000..9090).collect::
Retrieves a vec with all open ports for a given IP address. The default concurrency
is 100
if the Option
resolves to a None
value.
```rust use oports; use std::net::IpAddr;
let localhost = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1));
let ports = (8080..u16::maxvalue()).collect::