mirror of
https://github.com/searxng/searxng.git
synced 2025-07-13 08:19:17 +02:00
[enh] basic support for http proxy (see #236)
This commit is contained in:
parent
33516256fd
commit
cde37be4f5
3 changed files with 13 additions and 2 deletions
|
@ -66,8 +66,10 @@ class SessionSinglePool(requests.Session):
|
|||
|
||||
|
||||
def request(method, url, **kwargs):
|
||||
"""same as requests/requests/api.py request(...) except it use SessionSinglePool"""
|
||||
"""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)
|
||||
response = session.request(method=method, url=url, **kwargs)
|
||||
session.close()
|
||||
return response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue