MCPcopy Create free account
hub / github.com/6174/comflowyspace / getSystemProxy

Function getSystemProxy

apps/node/src/modules/utils/env.ts:50–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48export {systemProxy}
49let inited = false;
50export async function getSystemProxy() {
51 if (!inited) {
52 if (isMac) {
53 parseMacProxySettings();
54 } else if (isWindows) {
55 await parseWindowsProxySettings();
56 }
57
58 if (systemProxy.http_proxy) {
59 process.env.GLOBAL_AGENT_HTTP_PROXY = systemProxy.http_proxy
60 }
61
62 if (systemProxy.https_proxy) {
63 process.env.GLOBAL_AGENT_HTTPS_PROXY = systemProxy.https_proxy
64 }
65
66 systemProxyString = JSON.stringify(systemProxy);
67 inited = true;
68 }
69 return {
70 systemProxy,
71 systemProxyString
72 }
73}
74
75function parseMacProxySettings() {
76 const systemProxyString = execSync("scutil --proxy").toString();

Callers 6

downloadUrlFunction · 0.90
downloadUrlProFunction · 0.90
runCommandFunction · 0.90
runCommandWithPtyFunction · 0.90
proxyFetchFunction · 0.90
startTerminalMethod · 0.90

Calls 2

parseMacProxySettingsFunction · 0.85

Tested by

no test coverage detected