mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-07 05:11:51 +08:00
Merge pull request #107 from RuoJi6/feat/proxy-pool
feat: 全局代理池(健康检查、定时/失效轮换、热切换、脱敏)— Depends on #106
This commit is contained in:
1 parent
f0993424e5
commit
05dd5b40e8
20 files changed
+2646
-68
No files matched your search
@@ -3350,6 +3350,15 @@ export const settings: Settings = {
|
||||
tavily_key_set: true,
|
||||
web_search_proxy: "",
|
||||
global_proxy: "",
|
||||
proxy_pool: [],
|
||||
proxy_pool_active_id: "",
|
||||
proxy_rotate_timed_enabled: false,
|
||||
proxy_rotate_interval_seconds: 30,
|
||||
proxy_rotate_on_failure: false,
|
||||
proxy_rotate_strategy: "sequential",
|
||||
proxy_health_fail_threshold: 3,
|
||||
proxy_health_cooldown_seconds: 60,
|
||||
proxy_health_check_interval_seconds: 30,
|
||||
show_egress_ip: false,
|
||||
python_interpreter: "/usr/bin/python3",
|
||||
workers: 3,
|
||||
|
||||
@@ -2406,6 +2406,12 @@ function route(m: string, path: string, seg: string[], q: URLSearchParams, b: Re
|
||||
],
|
||||
warnings: [],
|
||||
};
|
||||
if (path === "/settings/proxy-pool" && m === "GET") return { entries: D.settings.proxy_pool ?? [], active_id: D.settings.proxy_pool_active_id ?? "", active_proxy: D.settings.global_proxy ?? "", switch_log: [] };
|
||||
if (path === "/settings/proxy-pool/import" && m === "POST") return { entries: D.settings.proxy_pool ?? [], active_id: D.settings.proxy_pool_active_id ?? "", switch_log: [], errors: [] };
|
||||
if (path === "/settings/proxy-pool/test-all" && m === "POST") return { entries: D.settings.proxy_pool ?? [], active_id: D.settings.proxy_pool_active_id ?? "", switch_log: [] };
|
||||
if (path.startsWith("/settings/proxy-pool/") && m === "PUT") return { entry: { ...(D.settings.proxy_pool ?? []).find((x) => x.id === path.split("/").at(-1)), ...b } };
|
||||
if (path.startsWith("/settings/proxy-pool/") && m === "DELETE") return { ok: true };
|
||||
if (path.startsWith("/settings/proxy-pool/") && m === "POST") return { ok: true, active_id: path.split("/").at(-1), active_proxy: "" };
|
||||
if (path === "/settings/python/detect") return { python_interpreter: "/usr/bin/python3" };
|
||||
if (path === "/chat")
|
||||
return { reply: "(demo)我已把该建议注入为一条高优意图,work agent 会尽快执行。", mode: "hint" };
|
||||
|
||||
Reference in new issue
Block a user