A modern, lightweight web server written in Rust.
- Static file serving - Serve static files with directory listing support
- Reverse proxying - Proxy requests to backend servers with round-robin load balancing
- Lua scripting - Extend functionality with Lua scripts (optional feature)
- SSL/TLS encryption - Secure connections with HTTPS
- HTTP/2 support - Modern protocol support for faster performance
- Configuration reload - Auto-reload config on file change
- Multiple virtual hosts - Host multiple websites on a single server
- Single binary - Easy to deploy with no dependencies
# Build from source (requires Rust)
git clone https://github.com/DefectingCat/candy.git
cd candy
cargo build --releaseCopy and customize the example config:
cp config.example.toml config.toml
# Edit config.toml to your needs# Run with default config (config.toml)
cargo run --release
# Or run directly
./target/release/candy --config path/to/config.tomlThe project provides a Makefile to simplify common operations:
# Build (debug)
make build
# Build (release)
make release
# Run (debug mode)
make run
# Run with arguments
make run ARGS="--config path/to/config.toml"
# Development mode (auto-reload)
make dev
# Run all tests
make test
# Code formatting
make format
# Code linting
make lint
# Fix common lint issues
make fix
# Check compilation
make checkA simple configuration example:
[server]
listen = "0.0.0.0:8080"
workers = 4
log_level = "info"
[virtual_hosts.default]
root = "./html"
index_files = ["index.html", "index.htm"]
directory_listing = true
[virtual_hosts.example]
server_name = "example.com"
root = "./examples/example.com"
index_files = ["index.html"]- Configuration Guide - Detailed configuration options
- Examples - Usage examples for various scenarios
- CHANGELOG - Release history and changes
- TODO - Planned features
