summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-04-26 12:19:15 -0400
committerAdam Tauber <asciimoo@gmail.com>2015-04-26 12:19:15 -0400
commit1f0e6ce65ba5e255f423ad8ec6967d67fd4aec0b (patch)
tree6423a5cd83aa25efe859c8c00e73da861afb20d9 /searx/webapp.py
parent952473d297b2f0131196086f5824ae48f32d2922 (diff)
parent83e48fa89bd28a38b46a717d786cc7bfad26ff21 (diff)
downloadsearxng-1f0e6ce65ba5e255f423ad8ec6967d67fd4aec0b.tar.gz
searxng-1f0e6ce65ba5e255f423ad8ec6967d67fd4aec0b.zip
Merge pull request #297 from dalf/proxies
[enh] Implement http proxies for outgoing requests. (see #236)
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 0d06fbe0c..41f579551 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -111,6 +111,8 @@ _category_names = (gettext('files'),
gettext('news'),
gettext('map'))
+outgoing_proxies = settings.get('outgoing_proxies', None)
+
@babel.localeselector
def get_locale():
@@ -645,7 +647,8 @@ def image_proxy():
resp = requests.get(url,
stream=True,
timeout=settings['server'].get('request_timeout', 2),
- headers=headers)
+ headers=headers,
+ proxies=outgoing_proxies)
if resp.status_code == 304:
return '', resp.status_code