forked from Icycoide/searxng
[enh] Add multiple outgoing proxies
credits go to @bauruine see https://github.com/searx/searx/pull/1958
This commit is contained in:
parent
2fc3b17c85
commit
3786920df9
7 changed files with 172 additions and 36 deletions
|
@ -78,6 +78,7 @@ from searx.plugins import plugins
|
|||
from searx.plugins.oa_doi_rewrite import get_doi_resolver
|
||||
from searx.preferences import Preferences, ValidationException, LANGUAGE_CODES
|
||||
from searx.answerers import answerers
|
||||
from searx.poolrequests import get_global_proxies
|
||||
|
||||
|
||||
# serve pages with HTTP/1.1
|
||||
|
@ -149,8 +150,6 @@ _category_names = (gettext('files'),
|
|||
gettext('onions'),
|
||||
gettext('science'))
|
||||
|
||||
outgoing_proxies = settings['outgoing'].get('proxies') or None
|
||||
|
||||
_flask_babel_get_translations = flask_babel.get_translations
|
||||
|
||||
|
||||
|
@ -905,7 +904,7 @@ def image_proxy():
|
|||
stream=True,
|
||||
timeout=settings['outgoing']['request_timeout'],
|
||||
headers=headers,
|
||||
proxies=outgoing_proxies)
|
||||
proxies=get_global_proxies())
|
||||
|
||||
if resp.status_code == 304:
|
||||
return '', resp.status_code
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue