httpx: use "proxy" argument instead of deprecated "proxies"

This commit is contained in:
lilydjwg 2024-04-19 12:48:53 +08:00
parent 61b3705f35
commit f1ff604b4c

View file

@ -1,5 +1,5 @@
# MIT licensed # MIT licensed
# Copyright (c) 2020 lilydjwg <lilydjwg@gmail.com>, et al. # Copyright (c) 2020-2022,2024 lilydjwg <lilydjwg@gmail.com>, et al.
from typing import Dict, Optional, Tuple from typing import Dict, Optional, Tuple
@ -34,7 +34,7 @@ class HttpxSession(BaseSession):
client = httpx.AsyncClient( client = httpx.AsyncClient(
timeout = httpx.Timeout(self.timeout, pool=None), timeout = httpx.Timeout(self.timeout, pool=None),
http2 = True, http2 = True,
proxies = {'all://': proxy}, proxy = proxy,
verify = verify_cert, verify = verify_cert,
) )
self.clients[(proxy, verify_cert)] = client self.clients[(proxy, verify_cert)] = client