mirror of
https://github.com/searxng/searxng.git
synced 2025-12-23 04:00:02 +00:00
Allow 'using_tor_proxy' to be set for each engine individually
Check 'using_tor_proxy' for each engine individually instead of checking globally [fix] searx.network: update _rdns test to the last httpx version Co-authored-by: Alexandre Flament <alex@al-f.net>
This commit is contained in:
@@ -167,13 +167,14 @@ class Network:
|
||||
for transport in client._mounts.values(): # pylint: disable=protected-access
|
||||
if isinstance(transport, AsyncHTTPTransportNoHttp):
|
||||
continue
|
||||
if not getattr(transport, '_rdns', False):
|
||||
result = False
|
||||
break
|
||||
else:
|
||||
response = await client.get('https://check.torproject.org/api/ip')
|
||||
if not response.json()['IsTor']:
|
||||
result = False
|
||||
if getattr(transport, "_pool") and getattr(
|
||||
transport._pool, "_rdns", False # pylint: disable=protected-access
|
||||
):
|
||||
continue
|
||||
return False
|
||||
response = await client.get("https://check.torproject.org/api/ip", timeout=10)
|
||||
if not response.json()["IsTor"]:
|
||||
result = False
|
||||
Network._TOR_CHECK_RESULT[proxies] = result
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user