johansteffens/foxy

By johansteffens

Updated 12 months ago

A minimal, configuration-driven, hyper-extensible HTTP proxy library written in Rust.

Image
Networking
Security
API management
1

1.0K

johansteffens/foxy repository overview

Foxy 🦊

CI-Crate CI-Docker Crates.io Version Crates.io Downloads Rust Version Docker Version Docker Pulls License

A minimal, configuration-driven, hyper-extendible Rust HTTP proxy library.

Features

  • 🛣️ Powerful Routing: Predicate-based routing with path patterns, HTTP methods, headers, and query matching
  • 🔄 Flexible Filters: Pre and post-processing filters for request/response modification
  • ⚙️ Configuration Superpowers: Layered configuration from files and environment variables
  • 🌐 Fine-grained Control: Route-specific filter chains for precise request handling
  • 🔒 Pluggable Security Chain – configurable, provider-based request authentication with built-in providers
  • 🚀 Modern Async Architecture: Built on Tokio and Hyper for high performance
  • 📦 Lightweight Dependencies: Minimal external dependencies for core functionality
  • 🧩 Highly Extensible: Custom predicates, filters and security providers via simple traits

Quickstart

Run with Docker

Prerequisites: Docker 20.10+ installed

The project publishes multi‑arch images to GitHub Container Registry:

docker pull johansteffens/foxy:latest

Run the proxy, exposing the default port 8080 on your host:

docker run --rm -p 8080:8080 johansteffens/foxy:latest
Passing a custom configuration file
  1. Create (or copy) a config.json file on your host.
  2. Ensure your configuration binds to address 0.0.0.0
  3. Mount it into the container and tell Foxy where to find it with the FOXY_CONFIG_FILE environment variable:
docker run --rm -p 8080:8080 -v "$(pwd)/config.json:/app/config.json:ro" -e FOXY_CONFIG_FILE=/app/config.json -e RUST_LOG=debug johansteffens/foxy:latest 
Run with docker‑compose

If you prefer docker compose, drop the snippet below into docker-compose.yml and run docker compose up -d:

version: "3.9"
services:
  foxy:
    image: johansteffens/foxy:latest
    container_name: foxy
    ports:
      - "8080:8080"
    environment:
      # Tell Foxy to load the configuration we mounted
      FOXY_CONFIG_FILE: /config/config.json
    volumes:
      # Mount your custom configuration
      - ./config.json:/config/config.json:ro

Tip: When you update config.json, simply restart the container with
docker compose restart foxy to pick up the changes.

Tag summary

Content type

Image

Digest

sha256:ee37117ea

Size

9.4 MB

Last updated

12 months ago

docker pull johansteffens/foxy:0.3.12