Go REST API server thu thập và kiểm tra proxy sống từ 20+ nguồn công khai, hỗ trợ HTTP, HTTPS, SOCKS5, SOCKS4.
- 20+ nguồn — proxyscrape API, GitHub txt lists
- HTTP + SOCKS5/SOCKS4 — check live cho tất cả loại proxy
- 500 goroutines — check song song, cực nhanh
- Geolocation — ip-api.com batch (lọc theo quốc gia)
- Latency đo ms — filter theo tốc độ
- Redis store — persist qua restart, fallback in-memory nếu Redis không có
- Auto-refresh — cứ 30 phút crawl lại tự động
git clone https://github.com/davidtheheroes/proxy-scan
cd proxy-scan
# Copy config
cp .env.example .env
# Tải dependencies
go mod tidy
# Build
go build -o proxy-scan.exe ./cmd/server# Chạy trực tiếp (không cần Redis)
go run ./cmd/server/main.go
# Hoặc với Redis (optional, để persist data)
docker run -d -p 6379:6379 redis:alpine
go run ./cmd/server/main.goKhông cần auth. Kiểm tra server đang chạy.
curl http://localhost:8080/health
# {"status":"ok"}| Param | Mô tả | Ví dụ |
|---|---|---|
country |
ISO 2-letter code | VN, US |
type |
Loại proxy | http, https, socks5, socks4 |
max_ms |
Latency tối đa (ms) | 1000 |
limit |
Số lượng tối đa | 50 |
format |
json hoặc txt |
txt |
# Tất cả proxy VN dạng JSON
curl "http://localhost:8080/proxies?country=VN"
# SOCKS5 VN, latency < 1s
curl "http://localhost:8080/proxies?country=VN&type=socks5&max_ms=1000"
# Dạng text (ip:port mỗi dòng)
curl "http://localhost:8080/proxies?country=VN&format=txt"Trigger crawl ngay lập tức.
curl -X POST http://localhost:8080/refresh
# {"message":"refresh started"}Thống kê lần crawl gần nhất.
curl http://localhost:8080/statsPORT=8080
REDIS_ADDR=localhost:6379
REDIS_PASSWORD=
REDIS_DB=0
CHECK_WORKERS=500 # số goroutine check song song
REFRESH_INTERVAL=30m # chu kỳ auto-refresh
CHECK_TIMEOUT=8s # timeout mỗi proxy
PROXY_TTL=2h # TTL trong Redis