mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 03:32:33 +08:00
This commit is contained in:
parent
805454e037
commit
0d4784d098
|
@ -25,10 +25,14 @@ class ProxyManager:
|
|||
"https://": os.getenv("HTTPS_PROXY") or os.getenv("https_proxy"),
|
||||
}
|
||||
|
||||
if 'http' in self.ap.system_cfg.data['network-proxies']:
|
||||
if 'http' in self.ap.system_cfg.data['network-proxies'] and self.ap.system_cfg.data['network-proxies']['http']:
|
||||
self.forward_proxies['http://'] = self.ap.system_cfg.data['network-proxies']['http']
|
||||
if 'https' in self.ap.system_cfg.data['network-proxies']:
|
||||
if 'https' in self.ap.system_cfg.data['network-proxies'] and self.ap.system_cfg.data['network-proxies']['https']:
|
||||
self.forward_proxies['https://'] = self.ap.system_cfg.data['network-proxies']['https']
|
||||
|
||||
# 设置到环境变量
|
||||
os.environ['HTTP_PROXY'] = self.forward_proxies['http://']
|
||||
os.environ['HTTPS_PROXY'] = self.forward_proxies['https://']
|
||||
|
||||
def get_forward_proxies(self) -> dict:
|
||||
return self.forward_proxies.copy()
|
||||
|
|
Loading…
Reference in New Issue
Block a user