[enh] verify that Tor proxy works every time searx starts

based on @MarcAbonce commit on searx
This commit is contained in:
Alexandre Flament 2021-09-23 11:31:29 +02:00
parent 4cc1ee8565
commit f9c6393502
5 changed files with 70 additions and 22 deletions

View file

@ -12,7 +12,7 @@ import httpx
import anyio
import h2.exceptions
from .network import get_network, initialize
from .network import get_network, initialize, check_network_configuration
from .client import get_loop
from .raise_for_httperror import raise_for_httperror
@ -160,7 +160,7 @@ def delete(url, **kwargs):
async def stream_chunk_to_queue(network, queue, method, url, **kwargs):
try:
async with network.stream(method, url, **kwargs) as response:
async with await network.stream(method, url, **kwargs) as response:
queue.put(response)
# aiter_raw: access the raw bytes on the response without applying any HTTP content decoding
# https://www.python-httpx.org/quickstart/#streaming-responses