SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[mod] /image_proxy: use HTTP/1 instead of HTTP/2
Alexandre Flament3b0f70ed0f98
diff --git a/searx/network/network.py b/searx/network/network.pyindex e7dc5b56e..94e91593d 100644--- a/searx/network/network.py+++ b/searx/network/network.py@@ -289,6 +289,14 @@ def initialize(settings_engines=None, settings_outgoing=None):if isinstance(network, str):NETWORKS[engine_name] = NETWORKS[network]+ # the /image_proxy endpoint has a dedicated network.+ # same parameters than the default network, but HTTP/2 is disabled.+ # It decreases the CPU load average, and the total time is more or less the same+ if 'image_proxy' not in NETWORKS:+ image_proxy_params = default_params.copy()+ image_proxy_params['enable_http2'] = False+ NETWORKS['image_proxy'] = new_network(image_proxy_params)+@atexit.registerdef done():diff --git a/searx/webapp.py b/searx/webapp.pyindex 0b60969a8..3b7e0f972 100755--- a/searx/webapp.py+++ b/searx/webapp.py@@ -108,7 +108,7 @@ from searx.autocomplete import search_autocomplete, backends as autocomplete_bacfrom searx.languages import language_codes as languagesfrom searx.locales import LOCALE_NAMES, UI_LOCALE_CODES, RTL_LOCALESfrom searx.search import SearchWithPlugins, initialize as search_initialize-from searx.network import stream as http_stream+from searx.network import stream as http_stream, set_context_network_namefrom searx.search.checker import get_result as checker_get_resultfrom searx.settings_loader import get_default_settings_path@@ -1086,13 +1086,11 @@ def image_proxy():'Sec-GPC': '1','DNT': '1',}+ set_context_network_name('image_proxy')stream = http_stream(method = 'GET',url = url,- headers = request_headers,- timeout = settings['outgoing']['request_timeout'],- allow_redirects = True,- max_redirects = 20+ headers = request_headers)resp = next(stream)content_length = resp.headers.get('Content-Length')