WaspsWithBazookas

๐ŸŽฏ Test Dummy Server (httpbin-style)

โ€œThe fastest, simplest test target for your wasp army!โ€


๐Ÿš€ What is the Test Dummy Server?

The Test Dummy Server is a lightning-fast, zero-dependency HTTP server built with may_minihttp that mimics the best of httpbin. Itโ€™s designed to be the perfect target for load testing with WaspsWithBazookas, with ultra-fast responses and classic endpoints for every scenario.


๐ŸŒŸ Why Use This Test Dummy?


๐Ÿš€ Quick Start

# Build and run the test dummy server
cargo build --release --bin test-dummy
./target/release/test-dummy

# Or if installed via cargo install
test-dummy

# With custom configuration
test-dummy --port 9000 --host 0.0.0.0

โš™๏ธ Configuration Options

Command Line Arguments

test-dummy [OPTIONS]

Options:
  -p, --port <PORT>              Port to listen on (default: 8080)
  -i, --host <HOST>              Host/IP to bind to (default: 127.0.0.1)
  --https                        Enable HTTPS (requires certificate files)
  --cert <CERT>                  Path to SSL certificate file (PEM format)
  --key <KEY>                    Path to SSL private key file (PEM format)
  -h, --help                     Print help
  -V, --version                  Print version

Usage Examples

# Default configuration (HTTP on 127.0.0.1:8080)
test-dummy

# Custom port
test-dummy --port 9000

# Bind to all interfaces
test-dummy --host 0.0.0.0 --port 8080

# HTTPS with certificates (requires different HTTP server)
test-dummy --https --cert cert.pem --key key.pem

# Short form options
test-dummy -i 0.0.0.0 -p 9000

๐Ÿ“‹ Available Endpoints

Method Endpoint Description Status Code
GET / Fastest possible static response 200
GET /get Echo method and path as JSON 200
GET /status/:code Returns the given status code :code
GET /delay/:seconds Waits N seconds, then returns 200
GET /headers Returns request headers as JSON 200
GET /ip Returns a fake client IP as JSON 200
GET /uuid Returns a random UUID as JSON 200
ANY /anything Echoes method, path, headers, and body 200

๐Ÿ“ Endpoint Details

/ (Ultra-fast root)

/get

/status/:code

/delay/:seconds

/headers

/ip

/uuid

/anything


๐Ÿš€ Example Usage

# Start server on default port
test-dummy

# Test the endpoints
curl http://localhost:8080/

# Start on different port and test
test-dummy --port 9000
curl http://localhost:9000/get

# Start on all interfaces for remote access
test-dummy --host 0.0.0.0 --port 8080
curl http://your-server-ip:8080/headers

# Test with custom headers
curl -H "X-Test: 123" http://localhost:8080/headers

# Test status codes
curl -i http://localhost:8080/status/404

# Test delays
curl http://localhost:8080/delay/2

# Test POST with body
curl -X POST -d 'hello' http://localhost:8080/anything

๐Ÿ”’ HTTPS Support

Note: The current implementation using may_minihttp doesnโ€™t support HTTPS directly. The --https, --cert, and --key options are provided for future compatibility but will show an error message.

For HTTPS testing, consider:


๐ŸŽฏ Load Testing Scenarios


๐Ÿ”ง Customization

Want to add more endpoints? Just edit src/test_dummy.rs and follow the simple match logic. No frameworks, no magicโ€”just Rust and speed.


๐ŸŽ‰ Happy Load Testing!

The Test Dummy Server is now the perfect, ultra-fast, zero-dependency target for your WaspsWithBazookas swarm. Hammer it, break it, and enjoy the speed!