MCPcopy Index your code
hub / github.com/ZToolsCenter/ZTools / setProxyConfig

Method setProxyConfig

src/main/api/renderer/settings.ts:599–615  ·  view source on GitHub ↗
(config: {
    enabled: boolean
    url: string
  })

Source from the content-addressed store, hash-verified

597
598 // 设置代理配置
599 public async setProxyConfig(config: {
600 enabled: boolean
601 url: string
602 }): Promise<{ success: boolean; error?: string }> {
603 try {
604 proxyManager.setProxyConfig(config)
605 console.log('[Settings] 代理配置已更新:', config)
606
607 // 应用全局代理配置
608 await proxyManager.applyProxyToDefaultSession()
609
610 return { success: true }
611 } catch (error: unknown) {
612 console.error('[Settings] 设置代理配置失败:', error)
613 return { success: false, error: error instanceof Error ? error.message : '未知错误' }
614 }
615 }
616
617 // 设置窗口默认高度
618 public setWindowDefaultHeight(height: number): { success: boolean; error?: string } {

Callers 2

setupIPCMethod · 0.45
loadAndApplySettingsMethod · 0.45

Calls 1

Tested by

no test coverage detected