HTTPProxySuite is a Go project demonstrating a full HTTP request flow using custom proxies and servers built with standard libraries.
The suite includes:
- Forward Proxy – receives client requests and forwards them to the reverse proxy.
- Reverse Proxy – receives requests from the forward proxy and forwards them to the HTTP servers.
- HTTP Servers – process requests and return responses back through the proxy chain.
This project showcases lightweight, end-to-end request handling, proxying, and server communication in Go, all without third-party frameworks.
Only the key files are included below:
.
├── http-forward-proxy/
│ ├── main.go
│ └── Dockerfile
├── http-reverse-proxy/
│ ├── main.go
│ └── Dockerfile
├── http-server/
│ ├── main.go
│ ├── index_server_1.html
│ └── index_server_2.html
├── docker-compose.yml
└── README.md
http-forward-proxy/– contains the forward proxy server main code and Dockerfile.http-reverse-proxy/– contains the reverse proxy main code and Dockerfile.http-server/– contains the HTTP server code and key index files.docker-compose.yml– orchestrates the containers and networks.
- Docker >= 20.x
- Docker Compose >= 1.29.x
- Go >= 1.20 (for building the binaries)
docker-compose up --build -ddocker psThe reverse proxy mappings can be configured via the -map argument in the format:
<context_path>=<host>:<port>
Example in docker-compose.yml:
command: ["./reverse-proxy-server", "-host", "0.0.0.0", "-port", "7090", "-map", "/server1=http-server-1:8081,/server2=http-server-2:8082"]Server 1:
curl -v -x http://127.0.0.1:6790 http://reverse-proxy-server:7090/server1Server 2:
curl -v -x http://127.0.0.1:6790 http://reverse-proxy-server:7090/server2http-server/index_server_1.html→ served byhttp-server-1http-server/index_server_2.html→ served byhttp-server-2
internal-net– for reverse proxy and HTTP servers.public-net– exposed network for forward proxy.
docker-compose down- Forward proxy can route requests to any reverse proxy.
- Reverse proxy mapping can be updated via
-mapargument. - HTTP servers listen on all interfaces for container communication.
Specify your license here (e.g., MIT, Apache 2.0).