maxpool 1.5.53 → 1.5.54
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/package.json +1 -1
- package/src/index.js +19 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import net from 'node:net';
|
|
3
4
|
import { spawn, spawnSync } from 'node:child_process';
|
|
4
5
|
import { createInterface } from 'node:readline';
|
|
5
6
|
import { loadOrCreateConfig, loadConfig, saveConfig, atomicConfigUpdate, getConfigPath, loadState, saveState, getStatePath, getLogPath, readGeneration, flushConfigWrites, flushStateWrites } from './config.js';
|
|
@@ -7,6 +8,24 @@ import { setEventLogPath, installConsoleMirror, setConsoleStdoutSuppressed } fro
|
|
|
7
8
|
import { SleepGuard } from './sleep-guard.js';
|
|
8
9
|
import { AccountManager } from './account-manager.js';
|
|
9
10
|
import { createProxyServer, REQUEST_IDLE_MAX_MS } from './server.js';
|
|
11
|
+
|
|
12
|
+
// ── Happy Eyeballs: stop racing a dead IPv6 leg ────────────────────────────────
|
|
13
|
+
// Node 20 resolves both families and, 250ms after starting the IPv4 connect, races an
|
|
14
|
+
// IPv6 one (autoSelectFamily, autoSelectFamilyAttemptTimeout=250). On a machine whose
|
|
15
|
+
// resolver returns an AAAA that BLACKHOLES — a VPN advertising IPv6 it cannot carry is
|
|
16
|
+
// the common case — that second leg never completes and takes the whole connect down
|
|
17
|
+
// with it, surfacing as UND_ERR_CONNECT_TIMEOUT / ETIMEDOUT on a network that is
|
|
18
|
+
// otherwise fine (curl, which falls back cleanly, succeeds in the same second).
|
|
19
|
+
//
|
|
20
|
+
// Measured 2026-08-01 on this fleet: 6,848 connect failures in one day; A/B over 14
|
|
21
|
+
// requests gave 12/14 at the 250ms default vs 14/14 with the timeout raised. Raising it
|
|
22
|
+
// is preferred over disabling the race outright: real IPv6 still wins where it works,
|
|
23
|
+
// and a blackholed leg simply loses instead of poisoning the attempt. `dns
|
|
24
|
+
// setDefaultResultOrder('ipv4first')` was ALSO measured and is NOT reliable (6 of 14 in a
|
|
25
|
+
// degraded window) — it reorders preference but still starts the doomed leg.
|
|
26
|
+
net.setDefaultAutoSelectFamilyAttemptTimeout(
|
|
27
|
+
Math.max(1000, Number(process.env.MAXPOOL_FAMILY_ATTEMPT_TIMEOUT_MS) || 5000),
|
|
28
|
+
);
|
|
10
29
|
import { Prober } from './prober.js';
|
|
11
30
|
import { loginOAuth, fetchProfile, refreshAccessToken, isTokenExpiringSoon, tokenFingerprint } from './oauth.js';
|
|
12
31
|
import { TUI } from './tui.js';
|