@cat5th/rate-proxy
v0.1.0
Published
A rate-limited HTTP reverse proxy with concurrency control
Downloads
130
Maintainers
Readme
rate-proxy
A rate-limited HTTP reverse proxy with concurrency control. Built on top of @cat5th/pool.js.
Install
npm install -g @cat5th/rate-proxyUsage
TARGET=<target_url> [PORT=9999] [CONCURRENCY=5] [TIMEOUT=120000] rate-proxyEnvironment Variables
| Variable | Default | Description |
|---|---|---|
| TARGET | (required) | Upstream server URL |
| PORT | 9999 | Local port |
| CONCURRENCY | 5 | Max concurrent upstream requests |
| TIMEOUT | 120000 | Request timeout (ms) |
Examples
# Basic
TARGET=http://api.example.com rate-proxy
# Custom concurrency
TARGET=http://api.example.com CONCURRENCY=2 rate-proxy
# Via npx
TARGET=http://api.example.com npx @cat5th/rate-proxy# Access the proxy
curl http://localhost:9999/some/pathLicense
MIT
