MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / configureUpdateProxy

Function configureUpdateProxy

apps/desktop/main/update.ts:29–42  ·  view source on GitHub ↗

* 配置自动更新的代理设置 * electron-updater 通过环境变量读取代理配置

()

Source from the content-addressed store, hash-verified

27 * electron-updater 通过环境变量读取代理配置
28 */
29function configureUpdateProxy(): void {
30 const proxyUrl = getActiveProxyUrl()
31
32 if (proxyUrl) {
33 // 设置环境变量,electron-updater 会自动读取
34 process.env.HTTPS_PROXY = proxyUrl
35 process.env.HTTP_PROXY = proxyUrl
36 logger.info(`[Update] Using proxy: ${proxyUrl}`)
37 } else {
38 // 清除代理环境变量
39 delete process.env.HTTPS_PROXY
40 delete process.env.HTTP_PROXY
41 }
42}
43
44/**
45 * 切换到 R2 镜像源

Callers 2

checkUpdateFunction · 0.85
manualCheckForUpdatesFunction · 0.85

Calls 2

getActiveProxyUrlFunction · 0.90
infoMethod · 0.65

Tested by

no test coverage detected