proxy.http.handler module#
proxy.py#
⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging.
- copyright
2013-present by Abhinav Singh and contributors.
- license
BSD, see LICENSE for more details.
- class proxy.http.handler.HttpProtocolHandler(*args: Any, **kwargs: Any)[source]#
Bases:
proxy.core.base.tcp_server.BaseTcpServerHandler
[proxy.http.connection.HttpClientConnection
]HTTP, HTTPS, HTTP2, WebSockets protocol handler.
Accepts
Client
connection and delegates to HttpProtocolHandlerPlugin.- _abc_impl = <_abc._abc_data object>#
- _discover_plugin_klass(protocol: int) Optional[Type[proxy.http.plugin.HttpProtocolHandlerPlugin]] [source]#
Discovers and return matching HTTP handler plugin matching protocol.
- _initialize_plugin(klass: Type[proxy.http.plugin.HttpProtocolHandlerPlugin]) proxy.http.plugin.HttpProtocolHandlerPlugin [source]#
Initializes passed HTTP protocol handler plugin class.
- _parse_first_request(data: memoryview) bool [source]#
- static create(*args: Any) proxy.http.connection.HttpClientConnection [source]#
Implementations are responsible for creation of work objects from incoming args. This helps keep work core agnostic to creation of externally defined work class objects.
- async get_events() Dict[int, int] [source]#
Return sockets and events (read or write) that we are interested in.
- handle_data(data: memoryview) Optional[bool] [source]#
Handles incoming data from client.
- async handle_events(readables: List[int], writables: List[int]) bool [source]#
Returns True if proxy must tear down.
- initialize() None [source]#
Optionally upgrades connection to HTTPS, sets
conn
in non-blocking mode and initializes HTTP protocol plugins.
- plugin: Optional[proxy.http.plugin.HttpProtocolHandlerPlugin]#
- request: proxy.http.parser.parser.HttpParser#
- run() None [source]#
run() method is not used when in –threadless mode.
This is here just to maintain backward compatibility with threaded mode.
- selector: Optional[selectors.EpollSelector]#