.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.network.client.AsyncHTTPTransportNoHttp Class Reference
Inheritance diagram for searx.network.client.AsyncHTTPTransportNoHttp:
Collaboration diagram for searx.network.client.AsyncHTTPTransportNoHttp:

Public Member Functions

 __init__ (self, *args, **kwargs)
 handle_async_request (self, httpx.Request request)
None aclose (self)
 __aenter__ (self)
None __aexit__ (self, type[BaseException]|None exc_type=None, BaseException|None exc_value=None, TracebackType|None traceback=None)

Detailed Description

Block HTTP request

The constructor is blank because httpx.AsyncHTTPTransport.__init__ creates an SSLContext unconditionally:
https://github.com/encode/httpx/blob/0f61aa58d66680c239ce43c8cdd453e7dc532bfc/httpx/_transports/default.py#L271

Each SSLContext consumes more than 500kb of memory, since there is about one network per engine.

In consequence, this class overrides all public methods

For reference: https://github.com/encode/httpx/issues/2298

Definition at line 65 of file client.py.

Constructor & Destructor Documentation

◆ __init__()

searx.network.client.AsyncHTTPTransportNoHttp.__init__ ( self,
* args,
** kwargs )

Definition at line 78 of file client.py.

78 def __init__(self, *args, **kwargs): # type: ignore
79 # pylint: disable=super-init-not-called
80 # this on purpose if the base class is not called
81 pass
82

Member Function Documentation

◆ __aenter__()

searx.network.client.AsyncHTTPTransportNoHttp.__aenter__ ( self)

Definition at line 89 of file client.py.

89 async def __aenter__(self):
90 return self
91

◆ __aexit__()

None searx.network.client.AsyncHTTPTransportNoHttp.__aexit__ ( self,
type[BaseException] | None exc_type = None,
BaseException | None exc_value = None,
TracebackType | None traceback = None )

Definition at line 92 of file client.py.

97 ) -> None:
98 pass
99
100

◆ aclose()

None searx.network.client.AsyncHTTPTransportNoHttp.aclose ( self)

Definition at line 86 of file client.py.

86 async def aclose(self) -> None:
87 pass
88

◆ handle_async_request()

searx.network.client.AsyncHTTPTransportNoHttp.handle_async_request ( self,
httpx.Request request )

Definition at line 83 of file client.py.

83 async def handle_async_request(self, request: httpx.Request):
84 raise httpx.UnsupportedProtocol('HTTP protocol is disabled')
85

The documentation for this class was generated from the following file:
  • /home/andrew/Documents/code/public/searxng/searx/network/client.py