api/test: use proxy from external proxy env if available

This commit is contained in:
jj 2025-02-10 21:48:30 +00:00
parent d6b0fbc8ec
commit 8f57881a68
No known key found for this signature in database

View file

@ -4,6 +4,7 @@ import { env } from "../config.js";
import { runTest } from "../misc/run-test.js";
import { loadJSON } from "../misc/load-from-fs.js";
import { Red, Bright } from "../misc/console-text.js";
import { setGlobalDispatcher, ProxyAgent } from "undici";
import { randomizeCiphers } from "../misc/randomize-ciphers.js";
import { services } from "../processing/service-config.js";
@ -64,6 +65,10 @@ const printHeader = (service, padLen) => {
console.log(service + '='.repeat(50));
}
if (env.externalProxy) {
setGlobalDispatcher(new ProxyAgent(env.externalProxy));
}
const action = process.argv[2];
switch (action) {
case "get-services":