GinX is a lightweight reverse proxy server written in Go. It supports:
- 🔁 Round Robin Load Balancing – Distributes incoming requests evenly across multiple backend servers.
- ♻️ Hot Configuration Reloading – Reload configuration on the fly by pressing
r+ Enter. - 🗂️ Static File Serving – Serves static files directly from the server.
All routes are defined in a config.yaml file. Here's an example:
routes:
- path: /files/
backends:
- http://localhost:3000
- http://localhost:4000
stratergy: round_robin
- path: /static/
static_dir: ./static
path: The route path to match.backends: A list of backend servers for load balancing.stratergy: Load balancing strategy (round-robinsupported).static_dir: Directory path for serving static files.
git clone https://github.com/JoYBoY1210/Ginx.git
cd Ginxgo run main.goIn the terminal where the server is running, press:
r + Enter
This will reload the config.yaml file without restarting the server.
Ginx/
├── main.go # Main entry point
├── config.yaml # Configuration file for routes
├── router/
│ └── router.go # Sets routes and proxy logic
├── utils/
│ └── config.go # Configuration loader
└── public/ # Static files served via /static/
- Go standard library
gopkg.in/yaml.v2for YAML parsing
MIT License