From 90ad36f11d708d90be0a7a8ee09d3cbdb157c541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Fri, 6 Sep 2024 11:38:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=B3=BB=E7=BB=9F=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=B7=BB=E5=8A=A0=20`=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E4=BB=A3=E7=90=86HTTP=E8=AF=B7=E6=B1=82`=20=E7=9A=84?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=A1=B9=20(#343)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/modules/proxy/index.js | 1 + packages/core/src/shell/scripts/set-system-proxy/index.js | 6 +++++- packages/gui/src/view/pages/proxy.vue | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/core/src/modules/proxy/index.js b/packages/core/src/modules/proxy/index.js index 7ce7b90..59f85d2 100644 --- a/packages/core/src/modules/proxy/index.js +++ b/packages/core/src/modules/proxy/index.js @@ -54,6 +54,7 @@ module.exports = { name: '系统代理', use: 'local', other: [], + proxyHttp: true, setEnv: false, excludeIpList: { // region 常用国内可访问域名 diff --git a/packages/core/src/shell/scripts/set-system-proxy/index.js b/packages/core/src/shell/scripts/set-system-proxy/index.js index 4cb259f..f60703b 100644 --- a/packages/core/src/shell/scripts/set-system-proxy/index.js +++ b/packages/core/src/shell/scripts/set-system-proxy/index.js @@ -50,7 +50,11 @@ async function _winSetProxy (exec, ip, port, setEnv) { const proxyPath = extraPath.getProxyExePath() const execFun = 'global' - const proxyAddr = `http=http://${ip}:${port};https=http://${ip}:${port}` + let proxyAddr = `https=http://${ip}:${port}` + if (config.get().proxy.proxyHttp !== false) { + proxyAddr = `http=http://${ip}:${port};` + proxyAddr + } + log.info(`执行“设置系统代理”的程序: ${proxyPath} ${execFun} ${proxyAddr} ......(省略排除IP列表)`) await execFile(proxyPath, [execFun, proxyAddr, excludeIpStr]) diff --git a/packages/gui/src/view/pages/proxy.vue b/packages/gui/src/view/pages/proxy.vue index 047d31b..6719135 100644 --- a/packages/gui/src/view/pages/proxy.vue +++ b/packages/gui/src/view/pages/proxy.vue @@ -21,6 +21,14 @@ 卸载与恢复网络说明 + + + 是否代理HTTP请求 + + + 勾选时,同时代理HTTP和HTTPS请求;不勾选时,只代理HTTPS请求 + + 是否同时修改HTTPS_PROXY环境变量(不好用,不建议勾选)