A simple implementation of a forward proxy for HTTP requests in Go.
- HTTP proxy support
- In-memory caching
- Conditional requests (ETag, Last-Modified)
- Clone the repository:
git clone https://github.com/aniketpathak028/proxy-go.git
cd proxy-go
- Run using Podman:
make podman-run
- Configure your browser or use curl:
curl -x http://localhost:8080 http://example.com
proxy-go/
├── cmd/
│ └── main.go # Entry point
├── pkg/
│ ├── cache/ # Cache implementation
│ ├── proxy/ # Proxy server logic
│ └── utils/ # Helper functions
├── Dockerfile
└── Makefile
make podman-build
- Build container imagemake podman-run
- Run proxy server in containermake podman-clean
- Remove container image
Environment variables and their defaults:
PORT
: Default 8080CONTAINER_TAG
: Default "latest"
Example with custom port:
make podman-run PORT=3000
- HTTPS proxying not supported yet (will be added in future)
- In-memory cache only (no persistence)
- Single instance only (no clustering)
- Add HTTPS support
- Implement persistent caching
- LRU cache eviction policy