A fast and lightweight image proxy service built with Rust. Stream images from remote servers through your own endpoint.
Pixel Proxy allows you to serve images from external sources through your own domain. When a client requests /images/photo.jpg, the service fetches the image from a configured upstream server and streams it directly to the client.
- Memory efficient: Streams images without loading them entirely into memory
- Fast: Built with Rust and Axum for high performance
- Simple: Minimal configuration and setup
- Scalable: Handles multiple concurrent requests efficiently
-
Clone and build
git clone <your-repo> cd pixel-proxy cargo run
-
Test it out
curl http://localhost:3000/images/grill.png
This will fetch and return the image from
https://gustavskitchen.se/images/grill.png
Set the upstream server via environment variable:
UPSTREAM_BASE_URL=https://your-image-server.com cargo runDefault upstream: https://gustavskitchen.se
GET /images/{filename}
Examples:
/images/photo.jpg→{UPSTREAM_BASE_URL}/images/photo.jpg/images/icons/logo.png→{UPSTREAM_BASE_URL}/images/icons/logo.png
# Run in development mode
cargo run
# Run tests
cargo test
# Build for production
cargo build --releaseMIT