mirror of
https://github.com/wukko/cobalt.git
synced 2025-04-24 11:02:02 +02:00
api/test: use proxy from external proxy env if available
This commit is contained in:
parent
d6b0fbc8ec
commit
8f57881a68
1 changed files with 5 additions and 0 deletions
|
@ -4,6 +4,7 @@ import { env } from "../config.js";
|
||||||
import { runTest } from "../misc/run-test.js";
|
import { runTest } from "../misc/run-test.js";
|
||||||
import { loadJSON } from "../misc/load-from-fs.js";
|
import { loadJSON } from "../misc/load-from-fs.js";
|
||||||
import { Red, Bright } from "../misc/console-text.js";
|
import { Red, Bright } from "../misc/console-text.js";
|
||||||
|
import { setGlobalDispatcher, ProxyAgent } from "undici";
|
||||||
import { randomizeCiphers } from "../misc/randomize-ciphers.js";
|
import { randomizeCiphers } from "../misc/randomize-ciphers.js";
|
||||||
|
|
||||||
import { services } from "../processing/service-config.js";
|
import { services } from "../processing/service-config.js";
|
||||||
|
@ -64,6 +65,10 @@ const printHeader = (service, padLen) => {
|
||||||
console.log(service + '='.repeat(50));
|
console.log(service + '='.repeat(50));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (env.externalProxy) {
|
||||||
|
setGlobalDispatcher(new ProxyAgent(env.externalProxy));
|
||||||
|
}
|
||||||
|
|
||||||
const action = process.argv[2];
|
const action = process.argv[2];
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case "get-services":
|
case "get-services":
|
||||||
|
|
Loading…
Add table
Reference in a new issue