Skip to content

Latest commit

 

History

History
117 lines (83 loc) · 2.42 KB

File metadata and controls

117 lines (83 loc) · 2.42 KB

Candy

A modern, lightweight web server written in Rust.

dependency status

Features

  • 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

Quick Start

Installation

# Build from source (requires Rust)
git clone https://github.com/DefectingCat/candy.git
cd candy
cargo build --release

Configuration

Copy and customize the example config:

cp config.example.toml config.toml
# Edit config.toml to your needs

Run

# Run with default config (config.toml)
cargo run --release

# Or run directly
./target/release/candy --config path/to/config.toml

Using Makefile

The 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 check

Configuration Example

A 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"]

Documentation

License

MIT