A lightweight API proxy server that forwards requests to target services.
Forwards API requests to avoid CORS issues and add authentication layers to third-party APIs.
The proxy forwards essential headers to support various request types:
const INCLUDE_ON_REQUEST_HEADERS: &[&str] = &[
"Authorization",
"Content-Type",
"Content-Disposition",
"Content-Length",
"Accept",
"X-Requested-With"
];
- JSON API calls
- HTML/plain text responses
- Multipart form data (file uploads)
docker build -t api-proxy-server:latest .
docker run -p 5055:5055 api-proxy-server:latest
# Remove existing container if needed
docker rm -f api-proxy-server || true
# Run in background with a container name for easy management
docker run -d --name api-proxy-server -p 5055:5055 api-proxy-server:latest
To proxy a request to JSONPlaceholder:
GET http://localhost:5055/proxy/https://jsonplaceholder.typicode.com/todos/1
cargo run