TinyRP is a lightweight reverse proxy server written in Go, featuring configurable endpoints, health checks, and easy demo setup.
- ⚡ Configurable reverse proxy routes
- ❤️ Health check endpoint (
/ping
) - 📝 YAML-based configuration
- 🐳 Docker-based demo services
- Go 1.20 or newer
- Docker
- Make
The proxy is configured using a YAML file located at data/config.yaml
. Example configuration:
server:
host: "localhost"
listen_port: "8080"
resources:
- name: Server1
endpoint: /server1
destination_url: "http://localhost:9001"
health_interval: "2s"
-
Start the demo backend services:
make run-containers
-
Start the proxy server:
make run-proxy-server
-
Test the proxy:
- Health check:
http://localhost:8080/ping
- Backend services:
- Server 1:
http://localhost:8080/server1
- Server 2:
http://localhost:8080/server2
- Server 3:
http://localhost:8080/server3
- Server 1:
- Health check:
-
To stop the demo services:
make stop
make run-containers
— Starts demo HTTP services using Dockermake stop
— Stops all demo servicesmake run-proxy-server
— Starts the proxy servermake help
— Displays help information about available commands
├── cmd/
│ └── main.go # Application entry point
├── data/
│ └── config.yaml # Configuration file
├── internal/
│ ├── configs/
│ │ └── config.go # Configuration loading
│ └── server/
│ ├── healthcheck.go # Health check endpoint
│ ├── proxy_handlers.go# Proxy request handling
│ └── server.go # Main server setup
└── Makefile # Build and run commands
This project is licensed under the MIT License.
Made with ❤️ by rubuy-74