diff options
Diffstat (limited to 'searx/network/client.py')
-rw-r--r-- | searx/network/client.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/searx/network/client.py b/searx/network/client.py index 631e36f8f..b377e010f 100644 --- a/searx/network/client.py +++ b/searx/network/client.py @@ -120,7 +120,6 @@ class AsyncHTTPTransportFixed(httpx.AsyncHTTPTransport): def get_transport_for_socks_proxy(verify, http2, local_address, proxy_url, limit, retries): - global LOOP, TRANSPORT_KWARGS # support socks5h (requests compatibility): # https://requests.readthedocs.io/en/master/user/advanced/#socks # socks5:// hostname is resolved on client side @@ -136,7 +135,7 @@ def get_transport_for_socks_proxy(verify, http2, local_address, proxy_url, limit return AsyncProxyTransportFixed(proxy_type=proxy_type, proxy_host=proxy_host, proxy_port=proxy_port, username=proxy_username, password=proxy_password, rdns=rdns, - loop=LOOP, + loop=get_loop(), verify=verify, http2=http2, local_address=local_address, @@ -192,6 +191,11 @@ def new_client(enable_http, verify, enable_http2, return httpx.AsyncClient(transport=transport, mounts=mounts, max_redirects=max_redirects) +def get_loop(): + global LOOP + return LOOP + + def init(): # log for logger_name in ('hpack.hpack', 'hpack.table'): |