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

Function loadProxyConfig

apps/desktop/main/network/proxy.ts:67–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65 * 加载代理配置
66 */
67export function loadProxyConfig(): ProxyConfig {
68 const configPath = getConfigPath()
69
70 if (!fs.existsSync(configPath)) {
71 return { ...DEFAULT_CONFIG }
72 }
73
74 try {
75 const content = fs.readFileSync(configPath, 'utf-8')
76 const data = JSON.parse(content)
77 return migrateOldConfig(data)
78 } catch {
79 return { ...DEFAULT_CONFIG }
80 }
81}
82
83/**
84 * 保存代理配置

Callers 5

registerNetworkHandlersFunction · 0.90
applyProxyToSessionFunction · 0.85
testProxyConnectionFunction · 0.85
getActiveProxyUrlFunction · 0.85

Calls 3

migrateOldConfigFunction · 0.85
parseMethod · 0.80
getConfigPathFunction · 0.70

Tested by

no test coverage detected