A web server written in Go that supports static file serving and reverse proxying.
- Listen on a configurable port
- Serve static files (optional)
- Reverse proxy to one or more backends
go run .Example config.conf:
listen 8080
root ./static
proxy /api localhost:9000
proxy /proxy localhost:3000If you do not want to serve static files and only want to forward traffic:
listen 8080
proxy / localhost:9000All incoming requests will be forwarded to localhost:9000.
curl http://localhost:8080/
curl http://localhost:8080/api.
├── main.go
├── server.go
├── proxy.go
├── go.mod
├── utils.go
├── config.go
├── config.conf
├── static.go
├── README.md
└── static/
└── index.html
- Static file serving is optional
- If
rootis not defined, only proxy routes are used - If no route matches, the server returns
404 Not Found
