mirror of
https://github.com/isboyjc/GoProxy.git
synced 2026-05-07 05:32:50 +08:00
feat: ✨ implement geo-filtering with whitelist and blacklist support
- Added support for geo-filtering in the proxy pool, allowing configuration of allowed and blocked countries via environment variables. - Updated `.env.example` and `docker-compose.yml` to include `ALLOWED_COUNTRIES` for whitelist functionality. - Enhanced `CLAUDE.md`, `GEO_FILTER.md`, and `README.md` to document the new geo-filtering features and usage instructions. - Modified proxy validation logic to prioritize whitelist over blacklist during admission checks. - Improved WebUI to allow dynamic configuration of geo-filter settings.
This commit is contained in:
@@ -110,6 +110,11 @@ func (m *Manager) NeedsFetch(status *PoolStatus) (bool, string, string) {
|
||||
httpPct := float64(status.HTTP) / float64(status.HTTPSlots)
|
||||
socks5Pct := float64(status.SOCKS5) / float64(status.SOCKS5Slots)
|
||||
|
||||
// 如果两个协议都缺(都<50%),同时补充两个协议
|
||||
if httpPct < 0.5 && socks5Pct < 0.5 {
|
||||
return true, "refill", ""
|
||||
}
|
||||
// 只有一个协议缺时,优先补充更缺的
|
||||
if httpPct < 0.5 {
|
||||
return true, "refill", "http"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user