crab-net is both an executable binary that can be run, and a library that can be used in Rust programs.
Installing the command-line executable
Assuming you have Rust/Cargo installed , run this command in a terminal:
cargo install crab-net
It will make the crab-net command available in your PATH if you've allowed the PATH to be modified when installing Rust . cargo uninstall crab-net uninstalls.
Adding crab_net library as a dependency
Run this command in a terminal, in your project's directory:
cargo add crab-net
To add it manually, edit your project's Cargo.toml file and add to the [dependencies] section:
crab-net = "0.0.4"
The crab_net library will be automatically available globally.
Read the crab_net library documentation .
Back to the crate overview .
Readme
Crab Net
A CLI tool to generate TCP/TLS & UDP/DTLS traffic based on Tokio framework .
Cargo Install
cargo install crab-net
Help
./crab-net -- help
Simple stress test for servers
Usage: crab-net [ OPTIONS] -- destination < addr>
Options:
-d, -- destination < addr> Server address as IP:PORT
-c, -- connections < clients> Number of clients to simulate [ default: 1]
-l, -- length < length> Payload size as bytes [ default: 16]
-r, -- rate < rate> Defined as packets/sec [ default: 1]
-p, -- port < port> Starting source port for clients [ default: 8000]
-w, -- workers < workers> Number of worker threads for the Tokio runtime [ default: # CPU core]
-s, --timeout <timeout> Timeout between consecutive connections spawn as ms [default: 50]
--udp Send packets via UDP
--tls Send data over TLS
--ca <ca> PEM File to validate server credentials
-h, --help Print help
-V, --version Print version