A lightweight API proxy service written in Go that supports multiple endpoints, rate limiting, and proxy rotation.
- Multiple site/endpoint support
- API key rotation
- Rate limiting
- SOCKS5 and HTTP proxy support
- Detailed logging system
- Docker support
- CORS enabled
- Clone the repository
- Configure your settings:
- Copy
.env.example
to.env
- Copy
config.json.example
toconfig.json
- Copy
- Run the service:
docker-compose up -d
- Install Go 1.22 or later
- Configure your settings in
config.json
- Run the service:
go run main.go
PORT
: Server port (default: 3003)LOG_LEVEL
: Logging level (debug, info, warn, error)COMPOSE_PROJECT_NAME
: Docker compose project nameUID
: User ID for DockerGID
: Group ID for DockerDC_HTTP_PORT
: Docker container HTTP port
{
"GLOBAL_SETTINGS": {
"DIRECT_ACCESS": false,
"PROXIES": [
"socks5://user:pass@host:port",
"http://user:pass@host:port"
]
},
"SITES": {
"site-name": {
"domain": "https://api.example.com",
"PROXY_TYPE": "header",
"KEY": "X-Api-Key",
"VALUES": [
{"key1": 3},
{"key2": 3}
]
}
}
}
The proxy service accepts requests in the following format:
http://localhost:3003/proxy/{site-name}/{endpoint}
Example:
curl http://localhost:3003/proxy/myip4/
Logs are written to both console and proxy.log
file. You can view Docker container logs using:
docker-compose logs api-proxy
- Go 1.22+
- Docker and Docker Compose (for containerized deployment)
# Build locally
go build -o api-proxy
# Build Docker image
docker-compose build
MIT License