proxy.plugin.redirect_to_custom_server module#

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.

class proxy.plugin.redirect_to_custom_server.RedirectToCustomServerPlugin(uid: str, flags: argparse.Namespace, client: proxy.http.connection.HttpClientConnection, event_queue: proxy.core.event.queue.EventQueue, upstream_conn_pool: Optional[UpstreamConnectionPool] = None)[source]#

Bases: proxy.http.proxy.plugin.HttpProxyBasePlugin

Modifies client request to redirect all incoming requests to a fixed server address.

UPSTREAM_SERVER = b'http://localhost:8899/'#
_abc_impl = <_abc._abc_data object>#
before_upstream_connection(request: proxy.http.parser.parser.HttpParser) Optional[proxy.http.parser.parser.HttpParser][source]#

Handler called just before Proxy upstream connection is established.

Return optionally modified request object. If None is returned, upstream connection won’t be established.

Raise HttpRequestRejected or HttpProtocolException directly to drop the connection.