fly_catcher

Crates.iofly_catcher
lib.rsfly_catcher
version0.1.0
sourcesrc
created_at2023-08-06 13:21:55.806398
updated_at2023-08-06 13:21:55.806398
descriptionFly Catcher, a simple HTTP server that logs request parameters.
homepage
repositoryhttps://github.com/kubilaysalih/fly_catcher
max_upload_size
id937143
size24,419
kubilay (kubilaysalih)

documentation

README

Fly Catcher 🪰 Rust

Fly Catcher is a simple HTTP server that prints the parameters of incoming requests to the console in a beautiful manner.

Requirements

  • Rust Programming Language
  • Cargo package manager

The following Rust crates are used in this project:

  • hyper: For creating the HTTP server.
  • clap: For handling command-line arguments.
  • serde_json: For JSON processing.

Usage

Using Cargo

To start the server, run the following command in the project directory:

cargo run -- --host {HOST_IP} --port {PORT}

Using the Compiled Binary

After compiling the project, you can run the flycatcher binary directly. Replace the path with the location of the compiled binary:

./path/to/flycatcher --host {HOST_IP} --port {PORT}
  • {HOST_IP}: The IP address the server will connect to. Optional, defaults to the local IP address.
  • {PORT}: The port the server will listen on. Optional, defaults to 80.

Example:

cargo run -- --host 0.0.0.0 --port 8080

or

./path/to/flycatcher --host 0.0.0.0 --port 8080

These commands start the server at http://0.0.0.0:8080.

Logs

The server prints the timestamp, method, URI, and content of each request to the console. If the content is in JSON format, it is printed in a readable manner.

Contributing

This project is open-source and awaits your contributions. Feel free to make changes and send a pull request.

License

This project is licensed under the MIT license. For more details, see the LICENSE file.


README Created with ChatGPT

Commit count: 0

cargo fmt