🚀 A Rust HTTP toolbox for self-hosted users (built upon Rocket) https://git.forestier.app/HorlogeSkynet/cruiser
Go to file
Samuel FORESTIER c66f0bab4b Updates Cargo author metadata 2023-11-01 19:41:18 +01:00
src Minor import order improvement 2023-05-13 15:40:07 +02:00
.gitignore Initial commit 2022-06-26 16:58:07 +02:00
Cargo.lock Bumps dependencies 2023-05-13 15:46:17 +02:00
Cargo.toml Updates Cargo author metadata 2023-11-01 19:41:18 +01:00
LICENSE Updates LICENSE copyright as of 2023 2023-05-13 16:03:32 +02:00
README.md Fixes X-FORWARDED-FOR example in README and mentions X-REAL-IP support 2022-06-28 21:26:45 +02:00

README.md

cruiser

A Rust HTTP toolbox for self-hosted users (built upon Rocket)

Features

  • Connectivity check for Android captive portal detection (for captive_portal_http[s]_url or captive_portal_[other_]fallback_url[s] system options)
  • "What is my IP ?" service (plain text or JSON serialized outputs)

Build

cargo build

Usage

cruiser --help

Examples

cruiser --trusted-proxies 10.0.0.80 192.168.0.80

# Check connectivity
curl -w '%{http_code}' http://127.0.0.1:8000/
## => 204

# What is my IP ?
curl http://127.0.0.1:8000/ip
## => 127.0.0.1

curl http://127.0.0.1:8000/ip/json
## => {"ip":"127.0.0.1"}

curl -H "X-FORWARDED-FOR: 8.8.8.8, 10.0.0.80" http://127.0.0.1:8000/ip
## => 8.8.8.8

curl -H "X-REAL-IP: 8.8.8.8" http://127.0.0.1:8000/ip
## => 8.8.8.8

Contributing

Code format

rustup component add rustfmt
cargo fmt

Code analysis

rustup component add clippy
cargo clippy