why not add proxy support as a URL?
import { env } from "./env.mjs";
import { ProxyAgent } from "undici";
// env.PROXY_URL = 'http://username:password@ip:port';
const proxy = new URL(env.PROXY_URL);
// WORK
export const proxyAgent = new ProxyAgent({
uri: proxy.origin + proxy.pathname,
token: `Basic ${Buffer.from(`${proxy.username}:${proxy.password}`).toString('base64')}`,
});
// DONT WORK
export const proxyAgent2 = new ProxyAgent(proxy);
why not add proxy support as a URL?