A lightweight, simple reverse HTTP proxy that's fully configurable through a REST API. Perfect for routing, load balancing, and managing your backend services without complex configuration files.
- Simple REST API - Configure everything on the fly without restarting
- Lightweight - Built in Erlang for speed and reliability
- Backend Management - Add, update, or remove backends dynamically
- Routing Rules - Define flexible routing rules with path-based forwarding
- Load Balancing - Built-in round-robin dispatcher
- Middleware Support - Extensible middleware pipeline
- API Documentation - Swagger/OpenAPI spec included
- Clone the repository:
git clone https://github.com/yourusername/shrimp.git
cd shrimp- Build the project:
make- Start Shrimp:
_rel/shrimp_release/bin/shrimp_release startThe proxy will be available at http://localhost:8000 and the API at http://localhost:8000/api.
curl -X POST http://localhost:8000/api/backend \
-H "Content-Type: application/json" \
-d '{
"name": "service-1",
"url": "http://backend1.example.com",
"pool-size": 10
}'curl -X POST http://localhost:8000/api/rule \
-H "Content-Type: application/json" \
-d '{
"name": "api-rule",
"in": "/api",
"out": {
"backends": ["service-1"],
"dispatcher": "round_robin"
}
}'curl http://localhost:8000/api/test
# Request is forwarded to http://backend1.example.com/api/testView the full API specification:
curl http://localhost:8000/docGET /api/backend- List all backendsGET /api/backend/{name}- Get a specific backendPOST /api/backend- Create a new backendPUT /api/backend/{name}- Update a backendDELETE /api/backend/{name}- Delete a backend
GET /api/rule- List all rulesGET /api/rule/{name}- Get a specific rulePOST /api/rule- Create a new rulePUT /api/rule/{name}- Update a ruleDELETE /api/rule/{name}- Delete a rule
# Create two backends
curl -X POST http://localhost:8000/api/backend \
-H "Content-Type: application/json" \
-d '{"name": "api-1", "url": "http://api1.example.com"}'
curl -X POST http://localhost:8000/api/backend \
-H "Content-Type: application/json" \
-d '{"name": "api-2", "url": "http://api2.example.com"}'
# Create a rule that load balances across both
curl -X POST http://localhost:8000/api/rule \
-H "Content-Type: application/json" \
-d '{
"name": "balanced",
"in": "/api",
"out": {
"backends": ["api-1", "api-2"],
"dispatcher": "round_robin"
}
}'make # Build the project
make clean # Clean build artifacts
make test # Run testsShrimp is built with Erlang/OTP and uses:
- Cowboy - HTTP server and routing
- Gun - HTTP client for forwarding requests
- JSX - JSON encoding/decoding
See LICENSE file for details.
