@swimmingliu/autovpn 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pipeline/egress.js
CHANGED
|
@@ -65,7 +65,13 @@ export function resolveEgressPolicy(env = process.env) {
|
|
|
65
65
|
}
|
|
66
66
|
/** Status codes a vendor or its CDN uses when it stops serving this client. */
|
|
67
67
|
const BLOCK_STATUS = new Set([403, 407, 429, 451, 503]);
|
|
68
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Body wording a block page uses. Every phrase needs a ban context: an
|
|
70
|
+
* accelerator's marketing copy legitimately says "隐藏您的IP地址" (hide your
|
|
71
|
+
* IP), and a bare `您的IP` read that as a ban, emptied the official-site
|
|
72
|
+
* response, and made 蜜蜂's APK undiscoverable for the whole run.
|
|
73
|
+
*/
|
|
74
|
+
const BLOCK_BODY_PATTERN = /封禁|封鎖|封锁|禁止访问|禁止訪問|(?:访问|訪問)受限|异常访问|異常訪問|请求过于频繁|請求過於頻繁|操作频繁|操作頻繁|(?:您的|你的|当前|當前|该|該)?\s*IP\s*(?:地址|位址)?\s*(?:已)?\s*(?:被|遭)\s*(?:封|禁|鎖|锁|限制|拉黑)|(?:您的|你的|当前|當前)?\s*IP\s*(?:已被|被)\s*(?:封禁|封鎖|封锁|限制|禁止)|too\s*many\s*requests|rate\s*limit|access\s*denied|forbidden|you\s+have\s+been\s+blocked|cf-browser-verification|just\s*a\s*moment|attention\s*required|captcha/i;
|
|
69
75
|
/** Classify a response or transport error for the switch decision. */
|
|
70
76
|
export function classifyEgressFailure(input) {
|
|
71
77
|
const status = Number(input.status ?? 0);
|