feat: http proxy support
thanks from shanto12 (PR#6349 which has original code)
This commit is contained in:
@@ -132,6 +132,23 @@ async function ensureTempDirExists(): Promise<string> {
|
|||||||
return gooseTempDir;
|
return gooseTempDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function configureProxy() {
|
||||||
|
const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy;
|
||||||
|
const httpProxy = process.env.HTTP_PROXY || process.env.http_proxy;
|
||||||
|
const noProxy = process.env.NO_PROXY || process.env.no_proxy || '';
|
||||||
|
|
||||||
|
const proxyUrl = httpsProxy || httpProxy;
|
||||||
|
|
||||||
|
if (proxyUrl) {
|
||||||
|
console.log('[Main] Configuring proxy');
|
||||||
|
await session.defaultSession.setProxy({
|
||||||
|
proxyRules: proxyUrl,
|
||||||
|
proxyBypassRules: noProxy,
|
||||||
|
});
|
||||||
|
console.log('[Main] Proxy configured successfully');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (started) app.quit();
|
if (started) app.quit();
|
||||||
|
|
||||||
if (process.env.ENABLE_PLAYWRIGHT) {
|
if (process.env.ENABLE_PLAYWRIGHT) {
|
||||||
@@ -1806,6 +1823,8 @@ const focusWindow = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function appMain() {
|
async function appMain() {
|
||||||
|
await configureProxy();
|
||||||
|
|
||||||
// Ensure Windows shims are available before any MCP processes are spawned
|
// Ensure Windows shims are available before any MCP processes are spawned
|
||||||
await ensureWinShims();
|
await ensureWinShims();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user