Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

proxy-scan

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.

Tính năng

  • 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

Cài đặt

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

# 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.go

API Endpoints

GET /health

Không cần auth. Kiểm tra server đang chạy.

curl http://localhost:8080/health
# {"status":"ok"}

GET /proxies

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"

POST /refresh

Trigger crawl ngay lập tức.

curl -X POST http://localhost:8080/refresh
# {"message":"refresh started"}

GET /stats

Thống kê lần crawl gần nhất.

curl http://localhost:8080/stats

Config (.env)

PORT=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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages