https://github.com/jdockerty/gn
TCP/UDP tool for grugs
https://github.com/jdockerty/gn
rust rust-tools tcp-client tcp-server udp-client udp-server
Last synced: 10 months ago
JSON representation
TCP/UDP tool for grugs
- Host: GitHub
- URL: https://github.com/jdockerty/gn
- Owner: jdockerty
- Created: 2024-08-27T20:59:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-07T14:05:15.000Z (over 1 year ago)
- Last Synced: 2025-01-23T13:29:18.294Z (12 months ago)
- Topics: rust, rust-tools, tcp-client, tcp-server, udp-client, udp-server
- Language: Rust
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gn
A TCP/UDP tool like `nc`, but way dumber.
## Install
Install via `cargo`:
```sh
cargo install --git https://github.com/jdockerty/gn
```
## Usage
Write data using the `write` subcommand. This exposes numerous ways to interact
with the remote server, of which a new stream is used per write.
For example:
```sh
# Send 100 requests over TCP which contains "hello-world"
gn write --host 127.0.0.1:5000 --count 100 "hello-world"
# Write for a duration of 3s, from stdin, with "input"
echo "input" | gn write --host 127.0.0.1:5000 --duration 3s
# Write 5 concurrent requests for 1s over UDP
gn write --host 127.0.0.1:5000 --protocol udp --concurrency 5 "some_data"
```
This also bundles a server implementation using the `serve` subcommand, the
specified protocol to listen for incoming connections is determined via the
`--protocol` flag.
```
# Default to TCP
gn serve
# Listen for incoming UDP
gn serve --protocol udp
```