.oO SearXNG Developer Documentation Oo.
|
Public Member Functions | |
__init__ (self, enable_http=True, verify=True, enable_http2=False, max_connections=None, max_keepalive_connections=None, keepalive_expiry=None, proxies=None, using_tor_proxy=False, local_addresses=None, retries=0, retry_on_http_error=None, max_redirects=30, logger_name=None) | |
check_parameters (self) | |
iter_ipaddresses (self) | |
get_ipaddress_cycle (self) | |
iter_proxies (self) | |
get_proxy_cycles (self) | |
log_response (self, httpx.Response response) | |
get_client (self, verify=None, max_redirects=None) | |
aclose (self) | |
is_valid_response (self, response) | |
call_client (self, stream, method, url, **kwargs) | |
request (self, method, url, **kwargs) | |
stream (self, method, url, **kwargs) | |
aclose_all (cls) | |
Static Public Member Functions | |
bool | check_tor_proxy (httpx.AsyncClient client, proxies) |
extract_kwargs_clients (kwargs) | |
extract_do_raise_for_httperror (kwargs) | |
patch_response (response, do_raise_for_httperror) | |
Public Attributes | |
enable_http = enable_http | |
verify = verify | |
enable_http2 = enable_http2 | |
max_connections = max_connections | |
max_keepalive_connections = max_keepalive_connections | |
keepalive_expiry = keepalive_expiry | |
proxies = proxies | |
using_tor_proxy = using_tor_proxy | |
local_addresses = local_addresses | |
retries = retries | |
retry_on_http_error = retry_on_http_error | |
max_redirects = max_redirects | |
Protected Attributes | |
_local_addresses_cycle = self.get_ipaddress_cycle() | |
_proxies_cycle = self.get_proxy_cycles() | |
dict | _clients = {} |
_logger = logger.getChild(logger_name) if logger_name else logger | |
Static Protected Attributes | |
dict | _TOR_CHECK_RESULT = {} |
Static Private Attributes | |
tuple | __slots__ |
Definition at line 38 of file network.py.
searx.network.network.Network.__init__ | ( | self, | |
enable_http = True, | |||
verify = True, | |||
enable_http2 = False, | |||
max_connections = None, | |||
max_keepalive_connections = None, | |||
keepalive_expiry = None, | |||
proxies = None, | |||
using_tor_proxy = False, | |||
local_addresses = None, | |||
retries = 0, | |||
retry_on_http_error = None, | |||
max_redirects = 30, | |||
logger_name = None ) |
Definition at line 61 of file network.py.
searx.network.network.Network.aclose | ( | self | ) |
Definition at line 207 of file network.py.
References searx.network.network.Network._clients.
searx.network.network.Network.aclose_all | ( | cls | ) |
Definition at line 295 of file network.py.
searx.network.network.Network.call_client | ( | self, | |
stream, | |||
method, | |||
url, | |||
** | kwargs ) |
Definition at line 259 of file network.py.
References searx.network.network.Network._logger, searx.network.network.Network.get_client(), searx.network.network.Network.is_valid_response(), and searx.network.network.Network.retries.
Referenced by searx.network.network.Network.request(), and searx.network.network.Network.stream().
searx.network.network.Network.check_parameters | ( | self | ) |
Definition at line 97 of file network.py.
References searx.network.network.Network.iter_ipaddresses(), and searx.network.network.Network.proxies.
|
static |
Definition at line 160 of file network.py.
Referenced by searx.network.network.Network.get_client().
|
static |
Definition at line 229 of file network.py.
|
static |
Definition at line 217 of file network.py.
searx.network.network.Network.get_client | ( | self, | |
verify = None, | |||
max_redirects = None ) |
Definition at line 180 of file network.py.
References searx.network.network.Network._clients, searx.network.network.Network._local_addresses_cycle, searx.network.network.Network._proxies_cycle, searx.network.network.Network.check_tor_proxy(), searx.network.network.Network.enable_http, searx.network.network.Network.enable_http2, searx.network.network.Network.keepalive_expiry, searx.network.network.Network.log_response(), searx.network.network.Network.max_connections, searx.network.network.Network.max_keepalive_connections, searx.network.network.Network.max_redirects, searx.network.network.Network.using_tor_proxy, and searx.network.network.Network.verify.
Referenced by searx.network.network.Network.call_client().
searx.network.network.Network.get_ipaddress_cycle | ( | self | ) |
Definition at line 115 of file network.py.
References searx.network.network.Network.iter_ipaddresses().
searx.network.network.Network.get_proxy_cycles | ( | self | ) |
Definition at line 143 of file network.py.
References searx.network.network.Network.iter_proxies().
searx.network.network.Network.is_valid_response | ( | self, | |
response ) |
Definition at line 249 of file network.py.
References searx.network.network.Network.retry_on_http_error.
Referenced by searx.network.network.Network.call_client().
searx.network.network.Network.iter_ipaddresses | ( | self | ) |
Definition at line 107 of file network.py.
References searx.network.network.Network.local_addresses.
Referenced by searx.network.network.Network.check_parameters(), and searx.network.network.Network.get_ipaddress_cycle().
searx.network.network.Network.iter_proxies | ( | self | ) |
Definition at line 130 of file network.py.
References searx.network.network.Network.proxies.
Referenced by searx.network.network.Network.get_proxy_cycles().
searx.network.network.Network.log_response | ( | self, | |
httpx.Response | response ) |
Definition at line 151 of file network.py.
References searx.network.network.Network._logger.
Referenced by searx.network.network.Network.get_client().
|
static |
Definition at line 237 of file network.py.
searx.network.network.Network.request | ( | self, | |
method, | |||
url, | |||
** | kwargs ) |
Definition at line 288 of file network.py.
References searx.network.network.Network.call_client().
searx.network.network.Network.stream | ( | self, | |
method, | |||
url, | |||
** | kwargs ) |
Definition at line 291 of file network.py.
References searx.network.network.Network.call_client().
Referenced by searx.webutils.CSVWriter.writerow().
|
staticprivate |
Definition at line 40 of file network.py.
|
protected |
Definition at line 93 of file network.py.
Referenced by searx.network.network.Network.aclose(), and searx.network.network.Network.get_client().
|
protected |
Definition at line 91 of file network.py.
Referenced by searx.network.network.Network.get_client().
|
protected |
Definition at line 94 of file network.py.
Referenced by searx.network.network.Network.call_client(), and searx.network.network.Network.log_response().
|
protected |
Definition at line 92 of file network.py.
Referenced by searx.network.network.Network.get_client().
|
staticprotected |
Definition at line 59 of file network.py.
searx.network.network.Network.enable_http = enable_http |
Definition at line 79 of file network.py.
Referenced by searx.network.network.Network.get_client().
searx.network.network.Network.enable_http2 = enable_http2 |
Definition at line 81 of file network.py.
Referenced by searx.network.network.Network.get_client().
searx.network.network.Network.keepalive_expiry = keepalive_expiry |
Definition at line 84 of file network.py.
Referenced by searx.network.network.Network.get_client().
searx.network.network.Network.local_addresses = local_addresses |
Definition at line 87 of file network.py.
Referenced by searx.network.network.Network.iter_ipaddresses().
searx.network.network.Network.max_connections = max_connections |
Definition at line 82 of file network.py.
Referenced by searx.network.network.Network.get_client().
searx.network.network.Network.max_keepalive_connections = max_keepalive_connections |
Definition at line 83 of file network.py.
Referenced by searx.network.network.Network.get_client().
searx.network.network.Network.max_redirects = max_redirects |
Definition at line 90 of file network.py.
Referenced by searx.network.network.Network.get_client().
searx.network.network.Network.proxies = proxies |
Definition at line 85 of file network.py.
Referenced by searx.network.network.Network.check_parameters(), and searx.network.network.Network.iter_proxies().
searx.network.network.Network.retries = retries |
Definition at line 88 of file network.py.
Referenced by searx.network.network.Network.call_client().
searx.network.network.Network.retry_on_http_error = retry_on_http_error |
Definition at line 89 of file network.py.
Referenced by searx.network.network.Network.is_valid_response().
searx.network.network.Network.using_tor_proxy = using_tor_proxy |
Definition at line 86 of file network.py.
Referenced by searx.network.network.Network.get_client().
searx.network.network.Network.verify = verify |
Definition at line 80 of file network.py.
Referenced by searx.network.network.Network.get_client().