summaryrefslogtreecommitdiff
path: root/searx/poolrequests.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-08-02 19:38:27 +0200
committerAdam Tauber <asciimoo@gmail.com>2015-08-02 20:32:22 +0200
commit1fcf066a8188b28eb644ea304a131d40b1b341eb (patch)
tree2e5dbd18300e41fc93870921840d3cafbc701d97 /searx/poolrequests.py
parentd0830d4edf8a9ee794d5897afd813c88f0ea720b (diff)
downloadsearxng-1fcf066a8188b28eb644ea304a131d40b1b341eb.tar.gz
searxng-1fcf066a8188b28eb644ea304a131d40b1b341eb.zip
[mod] change settings file structure according to #314
Diffstat (limited to 'searx/poolrequests.py')
-rw-r--r--searx/poolrequests.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/searx/poolrequests.py b/searx/poolrequests.py
index e2a757665..c44bdc7e2 100644
--- a/searx/poolrequests.py
+++ b/searx/poolrequests.py
@@ -39,11 +39,11 @@ class HTTPAdapterWithConnParams(requests.adapters.HTTPAdapter):
block=self._pool_block, **self._conn_params)
-if settings.get('source_ips'):
+if settings['outgoing'].get('source_ips'):
http_adapters = cycle(HTTPAdapterWithConnParams(pool_connections=100, source_address=(source_ip, 0))
- for source_ip in settings['source_ips'])
+ for source_ip in settings['outgoing']['source_ips'])
https_adapters = cycle(HTTPAdapterWithConnParams(pool_connections=100, source_address=(source_ip, 0))
- for source_ip in settings['source_ips'])
+ for source_ip in settings['outgoing']['source_ips'])
else:
http_adapters = cycle((HTTPAdapterWithConnParams(pool_connections=100), ))
https_adapters = cycle((HTTPAdapterWithConnParams(pool_connections=100), ))
@@ -69,7 +69,7 @@ def request(method, url, **kwargs):
"""same as requests/requests/api.py request(...) except it use SessionSinglePool and force proxies"""
global settings
session = SessionSinglePool()
- kwargs['proxies'] = settings.get('outgoing_proxies', None)
+ kwargs['proxies'] = settings['outgoing'].get('proxies', None)
response = session.request(method=method, url=url, **kwargs)
session.close()
return response