Fix residential apply timeout (skip neko refresh) and require proxychains for relay.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
eric 2026-09-22 11:01:29 -05:00
parent 6777bdf056
commit f9d7c58c6e
2 changed files with 7 additions and 5 deletions

View File

@ -4581,7 +4581,7 @@ async def network_socks_patch(body: dict[str, Any]) -> dict[str, Any]:
egress_hub.apply_mode,
"residential",
chain=False,
refresh_neko=True,
refresh_neko=False, # never hang API on docker recreate
cfg=cfg,
)
except Exception:
@ -4625,7 +4625,7 @@ async def network_egress_patch(body: dict[str, Any] = Body(default={})) -> dict[
cover_neko_flag=cover.get("neko") if "neko" in cover else body.get("cover_neko"),
cover_relay_flag=cover.get("relay") if "relay" in cover else body.get("cover_relay"),
cover_uploads_flag=cover.get("uploads") if "uploads" in cover else body.get("cover_uploads"),
refresh_neko=bool(body.get("refresh_neko", True)),
refresh_neko=bool(body.get("refresh_neko", False)),
dialer=str(body.get("dialer") or "") or None,
)
except ValueError as exc:

View File

@ -220,20 +220,22 @@ export default function NetworkPage() {
async function applyEgress() {
setBusy("egress:apply");
try {
// refresh_neko=false: recreating Neko compose often hangs the request (timeout).
// Proxy env is picked up on next Neko start; residential apply must stay fast.
await fetchJson("/api/network/egress", {
method: "PATCH",
body: JSON.stringify({
mode: egressMode,
chain_residential: chainResidential,
cover: { neko: coverNeko, relay: coverRelay, uploads: coverUploads },
refresh_neko: true,
refresh_neko: false,
}),
});
toast.push(
egressMode === "off"
? "已切回机房直连"
: egressMode === "residential"
? "已启用静态住宅 IP(douyinweb-singbox :17891)"
? "已启用静态住宅 IP(:17891)"
: chainResidential
? "已启用 ShellCrash + 住宅链式落地"
: "已启用 ShellCrash 机场线路",
@ -255,7 +257,7 @@ export default function NetworkPage() {
};
setProbes(r.probes || []);
const ok = (r.probes || []).some((p) => p.target === "google" && p.ok);
toast.push(ok ? "出海探测成功" : "探测未通,检查 ShellCrash / SOCKS", ok ? "ok" : "err");
toast.push(ok ? "出口探测成功" : "探测未通,检查住宅 SOCKS / 本机 :17891", ok ? "ok" : "err");
} catch (e) {
toast.push((e as Error).message, "err");
} finally {