Skip to content

Commit

Permalink
fix: 尝试修复aiohttp请求时的代理配置 #21
Browse files Browse the repository at this point in the history
  • Loading branch information
helloplhm-qwq committed Jan 12, 2024
1 parent 068dc5a commit 5fb8913
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common/Httpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ async def AsyncRequest(url, options = {}):
@ return: common.Httpx.ClientResponse类型的响应数据
'''
if (not variable.aioSession):
variable.aioSession = aiohttp.ClientSession()
variable.aioSession = aiohttp.ClientSession(trust_env=True)
# 缓存读取
cache_key = f'{url}{options}'
if (isinstance(options.get('cache-ignore'), list)):
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ async def run_app():

async def initMain():
await scheduler.run()
variable.aioSession = aiohttp.ClientSession()
variable.aioSession = aiohttp.ClientSession(trust_env=True)
try:
await run_app()
logger.info("服务器启动成功,请按下Ctrl + C停止")
Expand Down

0 comments on commit 5fb8913

Please sign in to comment.