proxy.http.exception package#

Submodules#

Module contents#

proxy.py#

⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging.

copyright
  1. 2013-present by Abhinav Singh and contributors.

license

BSD, see LICENSE for more details.

exception proxy.http.exception.HttpProtocolException(message: Optional[str] = None, **kwargs: Any)[source]#

Bases: Exception

Top level HttpProtocolException exception class.

All exceptions raised during execution of HTTP request lifecycle MUST inherit HttpProtocolException base class. Implement response() method to optionally return custom response to client.

response(request: HttpParser) Optional[memoryview][source]#
exception proxy.http.exception.HttpRequestRejected(status_code: Optional[int] = None, reason: Optional[bytes] = None, headers: Optional[Dict[bytes, bytes]] = None, body: Optional[bytes] = None, **kwargs: Any)[source]#

Bases: proxy.http.exception.base.HttpProtocolException

Generic exception that can be used to reject the client requests.

Connections can either be dropped/closed or optionally an HTTP status code can be returned.

response(_request: HttpParser) Optional[memoryview][source]#
exception proxy.http.exception.ProxyAuthenticationFailed(**kwargs: Any)[source]#

Bases: proxy.http.exception.base.HttpProtocolException

Exception raised when HTTP Proxy auth is enabled and incoming request doesn’t present necessary credentials.

response(_request: HttpParser) memoryview[source]#
exception proxy.http.exception.ProxyConnectionFailed(host: str, port: int, reason: str, **kwargs: Any)[source]#

Bases: proxy.http.exception.base.HttpProtocolException

Exception raised when HttpProxyPlugin is unable to establish connection to upstream server.

response(_request: HttpParser) memoryview[source]#