A lightweight Express.js API that routes outbound GET requests through a rotating pool of proxies. Each request is forwarded through a randomly selected proxy, distributing traffic across the pool.
npm install
npm run devThe server starts on http://localhost:3000.
Create a proxies.txt file in the project root with one proxy per line:
# Without authentication
123.45.67.89:8080
# With authentication
98.76.54.32:3128:myuser:mypass
Format: host:port or host:port:username:password
| Variable | Default | Description |
|---|---|---|
PORT |
3000 |
Server listen port |
Fetches the target URL through a randomly selected proxy and returns the response.
Request:
curl "http://localhost:3000/proxy?url=https://api.example.com/data"Success Response (200):
{
"data": "<response from target URL>",
"proxy": "123.45.67.89:8080"
}Error Responses:
| Status | Cause |
|---|---|
400 |
Missing url query parameter |
500 |
No proxies loaded or request failed |
{
"error": "Failed to proxy request",
"details": "connect ETIMEDOUT"
}Returns server status.
{ "status": "ok" }| Command | Description |
|---|---|
npm start |
Start the server |
npm run dev |
Start with auto-reload via nodemon |
- Express — HTTP server and routing
- Axios — Outbound HTTP client
- https-proxy-agent — Proxy tunneling for HTTP/HTTPS targets
- cors — Cross-origin request support