diff options
Diffstat (limited to 'ATRI/utils/request.py')
-rw-r--r-- | ATRI/utils/request.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ATRI/utils/request.py b/ATRI/utils/request.py index 8dec9c7..2cfce85 100644 --- a/ATRI/utils/request.py +++ b/ATRI/utils/request.py @@ -1,11 +1,17 @@ import httpx +from ATRI.config import BotSelfConfig + + +proxy = BotSelfConfig.proxy +if not proxy: + proxy = dict() async def get(url: str, **kwargs): - async with httpx.AsyncClient() as client: + async with httpx.AsyncClient(proxies=proxy) as client: return await client.get(url, **kwargs) async def post(url: str, **kwargs): - async with httpx.AsyncClient() as client: + async with httpx.AsyncClient(proxies=proxy) as client: return await client.post(url, **kwargs) |